Skip to content

Commit

Permalink
ibc: use outbound_ics20_transfers_enabled chain parameter (#4101)
Browse files Browse the repository at this point in the history
this uses the existing outbound_ics20_transfers_enabled to gate ics20
withdrawals
  • Loading branch information
avahowell authored Mar 26, 2024
1 parent 2058857 commit 83f5311
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion crates/core/app/src/action_handler/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,18 @@ impl AppActionHandler for Action {
.check_stateful(state)
.await
}
Action::Ics20Withdrawal(action) => action.check_historical(state).await,
Action::Ics20Withdrawal(action) => {
// SAFETY: this is safe to check in parallel because IBC enablement cannot
// change during transaction execution.
if !state
.get_ibc_params()
.await?
.outbound_ics20_transfers_enabled
{
anyhow::bail!("transaction an ICS20 withdrawal, but outbound ICS20 withdrawals are not enabled");
}
action.check_historical(state).await
}
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 83f5311

Please sign in to comment.