use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId};
use crate::prelude::{DualTagged, MonoTagged, WalletAddress};
pub fn build_forward_address<'a, ChainB, ChainC>(
intermediate_destination_address: MonoTagged<ChainB, &'a WalletAddress>,
port: DualTagged<ChainB, ChainC, PortId>,
channel: &'a ChannelId,
final_destination_address: MonoTagged<ChainC, &'a WalletAddress>,
) -> WalletAddress {
let forward_address =
format!("{intermediate_destination_address}|{port}/{channel}:{final_destination_address}");
WalletAddress(forward_address)
}
pub fn build_invalid_forward_address<'a, ChainB, ChainC>(
intermediate_destination_address: MonoTagged<ChainB, &'a WalletAddress>,
port: DualTagged<ChainB, ChainC, PortId>,
channel: &'a ChannelId,
) -> WalletAddress {
let forward_address =
format!("{intermediate_destination_address}|{port}/{channel}:invalid address");
WalletAddress(forward_address)
}