penumbra_sdk_ibc/component/
state_key.rs

1use ibc_types::{core::client::ClientId, core::client::Height};
2
3use std::string::String;
4
5pub fn ibc_params() -> &'static str {
6    "ibc/params"
7}
8
9// these are internal helpers that are used by penumbra-ibc, but not part of the IBC spec (that is,
10// counterparties don't expect to verify proofs about them)
11pub fn client_processed_heights(client_id: &ClientId, height: &Height) -> String {
12    format!("ibc/clients/{client_id}/processedHeights/{height}")
13}
14pub fn client_processed_times(client_id: &ClientId, height: &Height) -> String {
15    format!("ibc/clients/{client_id}/processedTimes/{height}")
16}
17pub fn counter() -> &'static str {
18    "ibc/connection_counter"
19}
20
21pub mod ics20_value_balance {
22    use ibc_types::core::channel::ChannelId;
23    use penumbra_sdk_asset::asset;
24
25    pub fn prefix() -> &'static str {
26        "ibc/ics20-value-balance/"
27    }
28
29    pub fn by_asset_id(channel_id: &ChannelId, asset_id: &asset::Id) -> String {
30        format!("ibc/ics20-value-balance/{channel_id}/{asset_id}")
31    }
32}