pub fn for_chan_open_events(
        e: &Attributes,
        dst_chain: &dyn ChainHandle,
    ) -> Result<Self, BoxError> {
        let channel_id = e
            .channel_id()
            .as_ref()
            .ok_or_else(|| format!("channel_id missing in OpenAck event '{:?}'", e))?;

        let client = channel_connection_client(dst_chain, e.port_id(), channel_id)?.client;
        if client.client_state.refresh_period().is_none() {
            return Err(format!(
                "client '{}' on chain {} does not require refresh",
                client.client_id,
                dst_chain.id()
            )
            .into());
        }

        Ok(Client {
            dst_client_id: client.client_id.clone(),
            dst_chain_id: dst_chain.id(),
            src_chain_id: client.client_state.chain_id(),
        }
        .into())
    }
/// Build the client object associated with the given channel event attributes.
Build the client object associated with the given channel event attributes.
Build the client object associated with the given channel event attributes .
pub fn for_chan_open_events(
        e: &Attributes,
        dst_chain: &dyn ChainHandle,
    ) -> Result<Self, BoxError> {
        let channel_id = e
            .channel_id()
            .as_ref()
            .ok_or_else(|| format!("channel_id missing in OpenAck event '{:?}'", e))?;
        let client = channel_connection_client(dst_chain, e.port_id(), channel_id)?.client;
        if client.client_state.refresh_period().is_none() {
            return Err(format!(
                "client '{}' on chain {} does not require refresh",
                client.client_id,
                dst_chain.id()
            )
            .into());
        }
        Ok(Client {
            dst_client_id: client.client_id.clone(),
            dst_chain_id: dst_chain.id(),
            src_chain_id: client.client_state.chain_id(),
        }
        .into())
    }
pub fn for_chan_open_events ( e : & Attributes , dst_chain : & dyn ChainHandle , ) -> Result < Self , BoxError > { let channel_id = e . channel_id ( ) . as_ref ( ) . ok_or_else ( | | format ! ( " " e ) ) ? ; let client = channel_connection_client ( dst_chain , e . port_id ( ) , channel_id ) ? . client ; if client . client_state . refresh_period ( ) . is_none ( ) { return Err ( format ! ( " " client client_id dst_chain id ( ) ) . into ( ) ) ; } Ok ( Client { dst_client_id : client . client_id . clone ( ) , dst_chain_id : dst_chain . id ( ) , src_chain_id : client . client_state . chain_id ( ) , } . into ( ) ) }
Build the client object associated with the given channel event attributes.
Build the client object associated with the given channel event attributes .
e
&Attributes
dst_chain
&dyn ChainHandle
e
&Attributes
dst_chain
&dyn ChainHandle