penumbra_ibc/component/
app_handler.rsuse anyhow::Result;
use async_trait::async_trait;
use cnidarium::{StateRead, StateWrite};
use ibc_types::core::channel::msgs::{
MsgAcknowledgement, MsgChannelCloseConfirm, MsgChannelCloseInit, MsgChannelOpenAck,
MsgChannelOpenConfirm, MsgChannelOpenInit, MsgChannelOpenTry, MsgRecvPacket, MsgTimeout,
};
#[async_trait]
pub trait AppHandlerCheck: Send + Sync {
async fn chan_open_init_check<S: StateRead>(state: S, msg: &MsgChannelOpenInit) -> Result<()>;
async fn chan_open_try_check<S: StateRead>(state: S, msg: &MsgChannelOpenTry) -> Result<()>;
async fn chan_open_ack_check<S: StateRead>(state: S, msg: &MsgChannelOpenAck) -> Result<()>;
async fn chan_open_confirm_check<S: StateRead>(
state: S,
msg: &MsgChannelOpenConfirm,
) -> Result<()>;
async fn chan_close_confirm_check<S: StateRead>(
state: S,
msg: &MsgChannelCloseConfirm,
) -> Result<()>;
async fn chan_close_init_check<S: StateRead>(state: S, msg: &MsgChannelCloseInit)
-> Result<()>;
async fn recv_packet_check<S: StateRead>(state: S, msg: &MsgRecvPacket) -> Result<()>;
async fn timeout_packet_check<S: StateRead>(state: S, msg: &MsgTimeout) -> Result<()>;
async fn acknowledge_packet_check<S: StateRead>(
state: S,
msg: &MsgAcknowledgement,
) -> Result<()>;
}
#[async_trait]
pub trait AppHandlerExecute: Send + Sync {
async fn chan_open_init_execute<S: StateWrite>(state: S, msg: &MsgChannelOpenInit);
async fn chan_open_try_execute<S: StateWrite>(state: S, msg: &MsgChannelOpenTry);
async fn chan_open_ack_execute<S: StateWrite>(state: S, msg: &MsgChannelOpenAck);
async fn chan_open_confirm_execute<S: StateWrite>(state: S, msg: &MsgChannelOpenConfirm);
async fn chan_close_confirm_execute<S: StateWrite>(state: S, msg: &MsgChannelCloseConfirm);
async fn chan_close_init_execute<S: StateWrite>(state: S, msg: &MsgChannelCloseInit);
async fn recv_packet_execute<S: StateWrite>(state: S, msg: &MsgRecvPacket) -> Result<()>;
async fn timeout_packet_execute<S: StateWrite>(state: S, msg: &MsgTimeout) -> Result<()>;
async fn acknowledge_packet_execute<S: StateWrite>(
state: S,
msg: &MsgAcknowledgement,
) -> Result<()>;
}
pub trait AppHandler: AppHandlerCheck + AppHandlerExecute {}