pub fn pad_channel_id<ChainA: ChainHandle, ChainB: ChainHandle>(
    chain_a: &ChainA,
    chain_b: &ChainB,
    connection: &ConnectedConnection<ChainA, ChainB>,
    port_id: &TaggedPortIdRef<ChainA, ChainB>,
) -> Result<(), Error> {
    let client_id_a = &connection.client.client_id_a;
    let client_id_b = &connection.client.client_id_b;

    for i in 0..random_u64_range(1, 6) {
        debug!(
            "creating new channel id {} on chain/connection/client {}/{}/{}",
            i + 1,
            chain_a.id(),
            connection.connection_id_a,
            client_id_a,
        );

        let channel: Channel<ChainB, ChainA> = Channel {
            ordering: Order::Unordered,
            a_side: ChannelSide::new(
                chain_b.clone(),
                client_id_b.value().clone(),
                connection.connection_id_b.value().clone(),
                port_id.cloned().into_value(),
                None,
            ),
            b_side: ChannelSide::new(
                chain_a.clone(),
                client_id_a.value().clone(),
                connection.connection_id_a.value().clone(),
                port_id.cloned().into_value(),
                None,
            ),
            connection_delay: connection.connection.delay_period,
            version: None,
        };

        channel.build_chan_open_init_and_send()?;
    }

    Ok(())
}
/**
   Create a random number of dummy channel IDs so that the bootstrapped
   channel ID is random instead of being always `channel-0`.

   This would help us catch bugs where the channel IDs are used at
   the wrong side of the chain, but still got accepted because the
   channel IDs on both sides are the same.
*/
Create a random number of dummy channel IDs so that the bootstrapped
channel ID is random instead of being always `channel-0`.

This would help us catch bugs where the channel IDs are used at
the wrong side of the chain, but still got accepted because the
channel IDs on both sides are the same.
Create a random number of dummy channel IDs so that the bootstrapped channel ID is random instead of being always ` channel - 0 ` . This would help us catch bugs where the channel IDs are used at the wrong side of the chain but still got accepted because the channel IDs on both sides are the same .
pub fn pad_channel_id<ChainA: ChainHandle, ChainB: ChainHandle>(
    chain_a: &ChainA,
    chain_b: &ChainB,
    connection: &ConnectedConnection<ChainA, ChainB>,
    port_id: &TaggedPortIdRef<ChainA, ChainB>,
) -> Result<(), Error> {
    let client_id_a = &connection.client.client_id_a;
    let client_id_b = &connection.client.client_id_b;
    for i in 0..random_u64_range(1, 6) {
        debug!(
            "creating new channel id {} on chain/connection/client {}/{}/{}",
            i + 1,
            chain_a.id(),
            connection.connection_id_a,
            client_id_a,
        );
        let channel: Channel<ChainB, ChainA> = Channel {
            ordering: Order::Unordered,
            a_side: ChannelSide::new(
                chain_b.clone(),
                client_id_b.value().clone(),
                connection.connection_id_b.value().clone(),
                port_id.cloned().into_value(),
                None,
            ),
            b_side: ChannelSide::new(
                chain_a.clone(),
                client_id_a.value().clone(),
                connection.connection_id_a.value().clone(),
                port_id.cloned().into_value(),
                None,
            ),
            connection_delay: connection.connection.delay_period,
            version: None,
        };
        channel.build_chan_open_init_and_send()?;
    }
    Ok(())
}
pub fn pad_channel_id < ChainA : ChainHandle , ChainB : ChainHandle > ( chain_a : & ChainA , chain_b : & ChainB , connection : & ConnectedConnection < ChainA , ChainB > , port_id : & TaggedPortIdRef < ChainA , ChainB > , ) -> Result < ( ) , Error > { let client_id_a = & connection . client . client_id_a ; let client_id_b = & connection . client . client_id_b ; for i in 0 .. random_u64_range ( 1 , 6 ) { debug ! ( " " i 1 chain_a id ( ) connection connection_id_a client_id_a ) ; let channel : Channel < ChainB , ChainA > = Channel { ordering : Order :: Unordered , a_side : ChannelSide :: new ( chain_b . clone ( ) , client_id_b . value ( ) . clone ( ) , connection . connection_id_b . value ( ) . clone ( ) , port_id . cloned ( ) . into_value ( ) , None , ) , b_side : ChannelSide :: new ( chain_a . clone ( ) , client_id_a . value ( ) . clone ( ) , connection . connection_id_a . value ( ) . clone ( ) , port_id . cloned ( ) . into_value ( ) , None , ) , connection_delay : connection . connection . delay_period , version : None , } ; channel . build_chan_open_init_and_send ( ) ? ; } Ok ( ( ) ) }
Create a random number of dummy channel IDs so that the bootstrapped
channel ID is random instead of being always `channel-0`.
Create a random number of dummy channel IDs so that the bootstrapped channel ID is random instead of being always ` channel - 0 ` .
chain_a
&ChainA
chain_b
&ChainB
connection
&ConnectedConnection<ChainA, ChainB>
port_id
&TaggedPortIdRef<ChainA, ChainB>
chain_a
&ChainA
chain_b
&ChainB
connection
&ConnectedConnection<ChainA, ChainB>
port_id
&TaggedPortIdRef<ChainA, ChainB>