penumbra_sdk_community_pool/component/action_handler/
community_pool_spend.rs1use anyhow::Result;
2use async_trait::async_trait;
3use cnidarium::StateWrite;
4use cnidarium_component::ActionHandler;
5
6use crate::{component::StateWriteExt as _, CommunityPoolSpend};
7
8#[async_trait]
9impl ActionHandler for CommunityPoolSpend {
10 type CheckStatelessContext = ();
11 async fn check_stateless(&self, _context: ()) -> Result<()> {
12 Ok(())
15 }
16
17 async fn check_and_execute<S: StateWrite>(&self, mut state: S) -> Result<()> {
18 state.community_pool_withdraw(self.value).await
20 }
21}