Skip to content

Commit

Permalink
app(cp): fix remaining assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Jun 25, 2024
1 parent ea7be2e commit e732478
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
12 changes: 8 additions & 4 deletions crates/core/app/tests/app_can_disable_community_pool_spends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@ async fn app_can_disable_community_pool_spends() -> anyhow::Result<()> {
// After we deposit a note into the community pool, we should see the original pool contents,
// plus the amount that we deposited.
assert_eq!(
[(note.asset_id(), note.amount())]
[(note.asset_id(), note.amount()),
(*STAKING_TOKEN_ASSET_ID, Amount::zero())]
.into_iter()
.collect::<BTreeMap<_, _>>(),
post_deposit_pool_balance,
Expand Down Expand Up @@ -364,9 +365,12 @@ async fn app_can_disable_community_pool_spends() -> anyhow::Result<()> {
// After any possible voting period, we should see the same pool balance.
assert_eq!(
post_voting_period_pool_balance,
[(note.asset_id(), note.amount())]
.into_iter()
.collect::<BTreeMap<_, _>>(),
[
(note.asset_id(), note.amount()),
(*STAKING_TOKEN_ASSET_ID, Amount::zero())
]
.into_iter()
.collect::<BTreeMap<_, _>>(),
"a rejected proposal should not decrease the funds of the community pool"
);
assert_eq!(
Expand Down
13 changes: 9 additions & 4 deletions crates/core/app/tests/app_can_propose_community_pool_spends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,12 @@ async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> {
// After we deposit a note into the community pool, we should see the original pool contents,
// plus the amount that we deposited.
assert_eq!(
[(note.asset_id(), note.amount())]
.into_iter()
.collect::<BTreeMap<_, _>>(),
[
(note.asset_id(), note.amount()),
(*STAKING_TOKEN_ASSET_ID, Amount::zero())
]
.into_iter()
.collect::<BTreeMap<_, _>>(),
post_deposit_pool_balance,
"a community pool deposit should be reflected in the visible balance"
);
Expand Down Expand Up @@ -362,7 +365,9 @@ async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> {
// After the proposal passes, we should see the balance decrease by the amount proposed.
assert_eq!(
post_voting_period_pool_balance,
BTreeMap::default(),
[(*STAKING_TOKEN_ASSET_ID, Amount::zero())]
.into_iter()
.collect::<BTreeMap<_, _>>(),
"the successful proposal should decrease the funds of the community pool"
);
assert_eq!(
Expand Down

0 comments on commit e732478

Please sign in to comment.