penumbra_sdk_shielded_pool/component/
ics20_withdrawal_with_handler.rs

1use crate::Ics20Withdrawal;
2use penumbra_sdk_ibc::component::HostInterface;
3use std::marker::PhantomData;
4
5pub struct Ics20WithdrawalWithHandler<HI>(Ics20Withdrawal, PhantomData<HI>);
6
7impl<HI> Ics20WithdrawalWithHandler<HI> {
8    pub fn new(action: Ics20Withdrawal) -> Self {
9        Self(action, PhantomData)
10    }
11
12    pub fn action(&self) -> &Ics20Withdrawal {
13        &self.0
14    }
15
16    pub fn into_inner(self) -> Ics20Withdrawal {
17        self.0
18    }
19}
20
21impl<HI> From<Ics20WithdrawalWithHandler<HI>> for Ics20Withdrawal {
22    fn from(value: Ics20WithdrawalWithHandler<HI>) -> Self {
23        value.0
24    }
25}
26
27impl Ics20Withdrawal {
28    pub fn with_handler<HI: HostInterface>(self) -> Ics20WithdrawalWithHandler<HI> {
29        Ics20WithdrawalWithHandler::new(self)
30    }
31}