fn dst_app_version<ChainA: ChainHandle, ChainB: ChainHandle>(
    channel: &Channel<ChainA, ChainB>,
) -> Result<Version, Error> {
    let counterparty = channel.src_channel_id().map(|cid| Counterparty {
        port_id: channel.src_port_id().to_string(),
        channel_id: cid.to_string(),
    });

    let proposed_version = channel
        .src_version()
        .cloned()
        .unwrap_or(
            default_by_port(channel.src_port_id())
                .map_err(|e| Error::app_version(e.to_string()))?,
        )
        .into();

    debug!(
        "source channel end proposed version='{}'; original={:?}",
        proposed_version,
        channel.src_version()
    );

    let request = QueryAppVersionRequest {
        port_id: channel.dst_port_id().to_string(),
        connection_id: channel.dst_connection_id().to_string(),
        ordering: channel.ordering as i32,
        counterparty,
        proposed_version,
    };

    channel.dst_chain().app_version(request)
}
/// Fetches the application version from the destination
/// chain for the given [`Channel`].
Fetches the application version from the destination
chain for the given [`Channel`].
Fetches the application version from the destination chain for the given [ ` Channel ` ] .
fn dst_app_version<ChainA: ChainHandle, ChainB: ChainHandle>(
    channel: &Channel<ChainA, ChainB>,
) -> Result<Version, Error> {
    let counterparty = channel.src_channel_id().map(|cid| Counterparty {
        port_id: channel.src_port_id().to_string(),
        channel_id: cid.to_string(),
    });
    let proposed_version = channel
        .src_version()
        .cloned()
        .unwrap_or(
            default_by_port(channel.src_port_id())
                .map_err(|e| Error::app_version(e.to_string()))?,
        )
        .into();
    debug!(
        "source channel end proposed version='{}'; original={:?}",
        proposed_version,
        channel.src_version()
    );
    let request = QueryAppVersionRequest {
        port_id: channel.dst_port_id().to_string(),
        connection_id: channel.dst_connection_id().to_string(),
        ordering: channel.ordering as i32,
        counterparty,
        proposed_version,
    };
    channel.dst_chain().app_version(request)
}
fn dst_app_version < ChainA : ChainHandle , ChainB : ChainHandle > ( channel : & Channel < ChainA , ChainB > , ) -> Result < Version , Error > { let counterparty = channel . src_channel_id ( ) . map ( | cid | Counterparty { port_id : channel . src_port_id ( ) . to_string ( ) , channel_id : cid . to_string ( ) , } ) ; let proposed_version = channel . src_version ( ) . cloned ( ) . unwrap_or ( default_by_port ( channel . src_port_id ( ) ) . map_err ( | e | Error :: app_version ( e . to_string ( ) ) ) ? , ) . into ( ) ; debug ! ( " " proposed_version channel src_version ( ) ) ; let request = QueryAppVersionRequest { port_id : channel . dst_port_id ( ) . to_string ( ) , connection_id : channel . dst_connection_id ( ) . to_string ( ) , ordering : channel . ordering as i32 , counterparty , proposed_version , } ; channel . dst_chain ( ) . app_version ( request ) }
Fetches the application version from the destination
chain for the given [`Channel`].
Fetches the application version from the destination chain for the given [ ` Channel ` ] .
channel
&Channel<ChainA, ChainB>
channel
&Channel<ChainA, ChainB>