Skip to content

Commit

Permalink
app: fix test failing
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Jun 25, 2024
1 parent 47d038c commit ea7be2e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
13 changes: 11 additions & 2 deletions crates/core/app/tests/app_can_disable_community_pool_spends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use {
server::consensus::Consensus,
CommunityPoolStateReadExt as _,
},
penumbra_asset::STAKING_TOKEN_ASSET_ID,
penumbra_community_pool::{
CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend, StateReadExt as _,
},
Expand All @@ -21,6 +22,7 @@ use {
},
penumbra_mock_client::MockClient,
penumbra_mock_consensus::TestNode,
penumbra_num::Amount,
penumbra_proto::{
core::keys::v1::{GovernanceKey, IdentityKey},
penumbra::core::component::stake::v1::Validator as PenumbraValidator,
Expand Down Expand Up @@ -310,8 +312,15 @@ async fn app_can_disable_community_pool_spends() -> anyhow::Result<()> {

// At the outset, the pool should be empty.
assert_eq!(
original_pool_balance,
BTreeMap::default(),
original_pool_balance.len(),
1,
"fresh community pool only track the staking token"
);
assert_eq!(
*original_pool_balance
.get(&STAKING_TOKEN_ASSET_ID)
.expect("CP tracks staking token, even with no balance"),
Amount::zero(),
"the community pool should be empty at the beginning of the chain"
);

Expand Down
15 changes: 12 additions & 3 deletions crates/core/app/tests/app_can_propose_community_pool_spends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use {
server::consensus::Consensus,
CommunityPoolStateReadExt as _,
},
penumbra_asset::STAKING_TOKEN_ASSET_ID,
penumbra_community_pool::{
CommunityPoolDeposit, CommunityPoolOutput, CommunityPoolSpend, StateReadExt as _,
},
Expand All @@ -17,10 +18,11 @@ use {
},
penumbra_keys::{
keys::{SpendKey, SpendKeyBytes},
test_keys::{self},
test_keys,
},
penumbra_mock_client::MockClient,
penumbra_mock_consensus::TestNode,
penumbra_num::Amount,
penumbra_proto::{
core::keys::v1::{GovernanceKey, IdentityKey},
penumbra::core::component::stake::v1::Validator as PenumbraValidator,
Expand Down Expand Up @@ -303,8 +305,15 @@ async fn app_can_propose_community_pool_spends() -> anyhow::Result<()> {

// At the outset, the pool should be empty.
assert_eq!(
original_pool_balance,
BTreeMap::default(),
original_pool_balance.len(),
1,
"fresh community pool only track the staking token"
);
assert_eq!(
*original_pool_balance
.get(&STAKING_TOKEN_ASSET_ID)
.expect("CP tracks the staking token"),
Amount::zero(),
"the community pool should be empty at the beginning of the chain"
);

Expand Down

0 comments on commit ea7be2e

Please sign in to comment.