Skip to content

Commit

Permalink
feat(app): 🧊 community pool actions not accepted when frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
cratelyn committed Apr 16, 2024
1 parent d89aa8a commit 5086da9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/core/app/src/action_handler/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@ impl AppActionHandler for Action {
}
action.check_historical(state).await
}
// Reject community pool spends, deposits, and outputs if the pool is currently frozen.
Action::CommunityPoolSpend(_)
| Action::CommunityPoolOutput(_)
| Action::CommunityPoolDeposit(_)
// SAFETY: this is safe to check in parallel because the community pool's
// enablement cannot change during transaction execution.
if penumbra_governance::StateReadExt::get_governance_params(&state)
.await?
.community_pool_is_frozen =>
{
anyhow::bail!(
"transaction contains community pool actions, but the pool is currently frozen"
);
}
Action::CommunityPoolSpend(action) => action.check_historical(state).await,
Action::CommunityPoolOutput(action) => action.check_historical(state).await,
Action::CommunityPoolDeposit(action) => action.check_historical(state).await,
Expand Down

0 comments on commit 5086da9

Please sign in to comment.