use ibc_relayer_types::core::ics04_channel::channel::IdentifiedChannelEnd;
use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId};
pub struct PathIdentifiers {
pub port_id: PortId,
pub channel_id: ChannelId,
pub counterparty_port_id: PortId,
pub counterparty_channel_id: ChannelId,
}
impl PathIdentifiers {
pub fn from_channel_end(ice: IdentifiedChannelEnd) -> Option<Self> {
let counterparty = ice.channel_end.remote;
Some(Self {
port_id: ice.port_id,
channel_id: ice.channel_id,
counterparty_port_id: counterparty.port_id,
counterparty_channel_id: counterparty.channel_id?,
})
}
}