penumbra_sdk_ibc/component/
connection_counter.rs

1use ibc_types::core::connection::Version;
2use once_cell::sync::Lazy;
3use penumbra_sdk_proto::{penumbra::core::component::ibc::v1 as pb, DomainType};
4
5#[derive(Debug, Clone)]
6pub struct ConnectionCounter(pub u64);
7
8impl DomainType for ConnectionCounter {
9    type Proto = pb::ConnectionCounter;
10}
11
12impl TryFrom<pb::ConnectionCounter> for ConnectionCounter {
13    type Error = anyhow::Error;
14
15    fn try_from(p: pb::ConnectionCounter) -> Result<Self, Self::Error> {
16        Ok(ConnectionCounter(p.counter))
17    }
18}
19
20impl From<ConnectionCounter> for pb::ConnectionCounter {
21    fn from(c: ConnectionCounter) -> Self {
22        pb::ConnectionCounter { counter: c.0 }
23    }
24}
25
26pub static SUPPORTED_VERSIONS: Lazy<Vec<Version>> = Lazy::new(|| vec![Version::default()]);