pub fn build_conn_ack(&self) -> Result<Vec<Any>, ConnectionError> {
        let _expected_dst_connection = self
            .validated_expected_connection(ConnectionMsgType::OpenAck)
            .map_err(|e|
                ConnectionError::Failed(format!(
                    "ack options inconsistent with existing connection on destination chain; context={}", e
                )))?;

        let src_connection = self
            .src_chain()
            .query_connection(self.src_connection_id(), ICSHeight::default())
            .map_err(|e| ConnectionError::QueryError(self.src_chain().id(), e))?;

        // TODO - check that the src connection is consistent with the ack options

        // Build add **send** the message(s) for updating client on source.
        // TODO - add check if it is required
        let src_client_target_height = self
            .dst_chain()
            .query_latest_height()
            .map_err(|e| ConnectionError::QueryError(self.dst_chain().id(), e))?;
        let client_msgs = self.build_update_client_on_src(src_client_target_height)?;
        self.src_chain()
            .send_msgs(client_msgs)
            .map_err(|e| ConnectionError::SubmitError(self.src_chain().id(), e))?;

        let query_height = self
            .src_chain()
            .query_latest_height()
            .map_err(|e| ConnectionError::QueryError(self.src_chain().id(), e))?;
        let (client_state, proofs) = self
            .src_chain()
            .build_connection_proofs_and_client_state(
                ConnectionMsgType::OpenAck,
                self.src_connection_id(),
                self.src_client_id(),
                query_height,
            )
            .map_err(|e| {
                ConnectionError::Failed(format!("failed to build connection proofs: {}", e))
            })?;

        // Build message(s) for updating client on destination
        let mut msgs = self.build_update_client_on_dst(proofs.height())?;

        // Get signer
        let signer = self.dst_chain().get_signer().map_err(|e| {
            ConnectionError::Failed(format!(
                "failed while fetching the signer for dst chain ({}) with error: {}",
                self.dst_chain().id(),
                e
            ))
        })?;

        let new_msg = MsgConnectionOpenAck {
            connection_id: self.dst_connection_id().clone(),
            counterparty_connection_id: self.src_connection_id().clone(),
            client_state,
            proofs,
            version: src_connection.versions()[0].clone(),
            signer,
        };

        msgs.push(new_msg.to_any());
        Ok(msgs)
    }
/// Attempts to build a MsgConnOpenAck.
Attempts to build a MsgConnOpenAck.
Attempts to build a MsgConnOpenAck .
pub fn build_conn_ack(&self) -> Result<Vec<Any>, ConnectionError> {
        let _expected_dst_connection = self
            .validated_expected_connection(ConnectionMsgType::OpenAck)
            .map_err(|e|
                ConnectionError::Failed(format!(
                    "ack options inconsistent with existing connection on destination chain; context={}", e
                )))?;
        let src_connection = self
            .src_chain()
            .query_connection(self.src_connection_id(), ICSHeight::default())
            .map_err(|e| ConnectionError::QueryError(self.src_chain().id(), e))?;
        // TODO - check that the src connection is consistent with the ack options
        // Build add **send** the message(s) for updating client on source.
        // TODO - add check if it is required
        let src_client_target_height = self
            .dst_chain()
            .query_latest_height()
            .map_err(|e| ConnectionError::QueryError(self.dst_chain().id(), e))?;
        let client_msgs = self.build_update_client_on_src(src_client_target_height)?;
        self.src_chain()
            .send_msgs(client_msgs)
            .map_err(|e| ConnectionError::SubmitError(self.src_chain().id(), e))?;
        let query_height = self
            .src_chain()
            .query_latest_height()
            .map_err(|e| ConnectionError::QueryError(self.src_chain().id(), e))?;
        let (client_state, proofs) = self
            .src_chain()
            .build_connection_proofs_and_client_state(
                ConnectionMsgType::OpenAck,
                self.src_connection_id(),
                self.src_client_id(),
                query_height,
            )
            .map_err(|e| {
                ConnectionError::Failed(format!("failed to build connection proofs: {}", e))
            })?;
        // Build message(s) for updating client on destination
        let mut msgs = self.build_update_client_on_dst(proofs.height())?;
        // Get signer
        let signer = self.dst_chain().get_signer().map_err(|e| {
            ConnectionError::Failed(format!(
                "failed while fetching the signer for dst chain ({}) with error: {}",
                self.dst_chain().id(),
                e
            ))
        })?;
        let new_msg = MsgConnectionOpenAck {
            connection_id: self.dst_connection_id().clone(),
            counterparty_connection_id: self.src_connection_id().clone(),
            client_state,
            proofs,
            version: src_connection.versions()[0].clone(),
            signer,
        };
        msgs.push(new_msg.to_any());
        Ok(msgs)
    }
pub fn build_conn_ack ( & self ) -> Result < Vec < Any > , ConnectionError > { let _expected_dst_connection = self . validated_expected_connection ( ConnectionMsgType :: OpenAck ) . map_err ( | e | ConnectionError :: Failed ( format ! ( " " e ) ) ) ? ; let src_connection = self . src_chain ( ) . query_connection ( self . src_connection_id ( ) , ICSHeight :: default ( ) ) . map_err ( | e | ConnectionError :: QueryError ( self . src_chain ( ) . id ( ) , e ) ) ? ; // TODO - check that the src connection is consistent with the ack options // Build add **send** the message(s) for updating client on source. // TODO - add check if it is required let src_client_target_height = self . dst_chain ( ) . query_latest_height ( ) . map_err ( | e | ConnectionError :: QueryError ( self . dst_chain ( ) . id ( ) , e ) ) ? ; let client_msgs = self . build_update_client_on_src ( src_client_target_height ) ? ; self . src_chain ( ) . send_msgs ( client_msgs ) . map_err ( | e | ConnectionError :: SubmitError ( self . src_chain ( ) . id ( ) , e ) ) ? ; let query_height = self . src_chain ( ) . query_latest_height ( ) . map_err ( | e | ConnectionError :: QueryError ( self . src_chain ( ) . id ( ) , e ) ) ? ; let ( client_state , proofs ) = self . src_chain ( ) . build_connection_proofs_and_client_state ( ConnectionMsgType :: OpenAck , self . src_connection_id ( ) , self . src_client_id ( ) , query_height , ) . map_err ( | e | { ConnectionError :: Failed ( format ! ( " " e ) ) } ) ? ; // Build message(s) for updating client on destination let mut msgs = self . build_update_client_on_dst ( proofs . height ( ) ) ? ; // Get signer let signer = self . dst_chain ( ) . get_signer ( ) . map_err ( | e | { ConnectionError :: Failed ( format ! ( " " self dst_chain ( ) id ( ) e ) ) } ) ? ; let new_msg = MsgConnectionOpenAck { connection_id : self . dst_connection_id ( ) . clone ( ) , counterparty_connection_id : self . src_connection_id ( ) . clone ( ) , client_state , proofs , version : src_connection . versions ( ) [ 0 ] . clone ( ) , signer , } ; msgs . push ( new_msg . to_any ( ) ) ; Ok ( msgs ) }
Attempts to build a MsgConnOpenAck.
Attempts to build a MsgConnOpenAck .
&self
&self