penumbra_sdk_community_pool/
component.rs1pub mod state_key;
5
6mod action_handler;
7mod view;
8
9use std::sync::Arc;
10
11use async_trait::async_trait;
12use cnidarium::StateWrite;
13use cnidarium_component::Component;
14use tendermint::v0_37::abci;
15use tracing::instrument;
16pub use view::{StateReadExt, StateWriteExt};
17
18use crate::genesis;
19
20pub struct CommunityPool {}
21
22#[async_trait]
23impl Component for CommunityPool {
24 type AppState = genesis::Content;
25
26 #[instrument(name = "community_pool", skip(state, app_state))]
27 async fn init_chain<S: StateWrite>(mut state: S, app_state: Option<&Self::AppState>) {
28 match app_state {
29 Some(genesis) => {
30 state.put_community_pool_params(genesis.community_pool_params.clone());
31 state.community_pool_deposit(genesis.initial_balance).await;
32 }
33 None => {}
34 }
35 }
36
37 #[instrument(name = "community_pool", skip(_state, _begin_block))]
38 async fn begin_block<S: StateWrite + 'static>(
39 _state: &mut Arc<S>,
40 _begin_block: &abci::request::BeginBlock,
41 ) {
42 }
43
44 #[instrument(name = "community_pool", skip(_state, _end_block))]
45 async fn end_block<S: StateWrite + 'static>(
46 _state: &mut Arc<S>,
47 _end_block: &abci::request::EndBlock,
48 ) {
49 }
50
51 #[instrument(name = "community_pool", skip(_state))]
52 async fn end_epoch<S: StateWrite + 'static>(_state: &mut Arc<S>) -> anyhow::Result<()> {
53 Ok(())
54 }
55}