pub async fn msg_update_solo_machine_client<'e>(
    executor: impl Executor<'e, Database = Db>,
    signer: impl Signer,
    chain: &mut Chain,
    new_public_key: Option<&PublicKey>,
    memo: String,
    request_id: Option<&str>,
) -> Result<TxRaw> {
    if chain.connection_details.is_none() {
        bail!(
            "connection details not found for chain with id {}",
            chain.id
        );
    }

    let sequence = chain.sequence.into();

    let any_public_key = match new_public_key {
        Some(new_public_key) => new_public_key.to_any()?,
        None => signer.to_public_key()?.to_any()?,
    };

    let signature = get_header_proof(
        &signer,
        chain,
        Some(any_public_key.clone()),
        chain.config.diversifier.clone(),
        request_id,
    )
    .await?;

    *chain = chain::increment_sequence(executor, &chain.id).await?;

    let header = SoloMachineHeader {
        sequence,
        timestamp: to_u64_timestamp(chain.consensus_timestamp)?,
        signature,
        new_public_key: Some(any_public_key),
        new_diversifier: chain.config.diversifier.clone(),
    };

    let any_header = header.to_any()?;

    let connection_details = chain.connection_details.as_ref().ok_or_else(|| {
        anyhow!(
            "connection details not found for chain with id {}",
            chain.id
        )
    })?;

    let message = MsgUpdateClient {
        client_id: connection_details.solo_machine_client_id.to_string(),
        header: Some(any_header),
        signer: signer.to_account_address()?,
    };

    build(signer, chain, &[message], memo, request_id).await
}
/// Builds a transaction to update solo machine client on IBC enabled chain
Builds a transaction to update solo machine client on IBC enabled chain
Builds a transaction to update solo machine client on IBC enabled chain
pub async fn msg_update_solo_machine_client<'e>(
    executor: impl Executor<'e, Database = Db>,
    signer: impl Signer,
    chain: &mut Chain,
    new_public_key: Option<&PublicKey>,
    memo: String,
    request_id: Option<&str>,
) -> Result<TxRaw> {
    if chain.connection_details.is_none() {
        bail!(
            "connection details not found for chain with id {}",
            chain.id
        );
    }
    let sequence = chain.sequence.into();
    let any_public_key = match new_public_key {
        Some(new_public_key) => new_public_key.to_any()?,
        None => signer.to_public_key()?.to_any()?,
    };
    let signature = get_header_proof(
        &signer,
        chain,
        Some(any_public_key.clone()),
        chain.config.diversifier.clone(),
        request_id,
    )
    .await?;
    *chain = chain::increment_sequence(executor, &chain.id).await?;
    let header = SoloMachineHeader {
        sequence,
        timestamp: to_u64_timestamp(chain.consensus_timestamp)?,
        signature,
        new_public_key: Some(any_public_key),
        new_diversifier: chain.config.diversifier.clone(),
    };
    let any_header = header.to_any()?;
    let connection_details = chain.connection_details.as_ref().ok_or_else(|| {
        anyhow!(
            "connection details not found for chain with id {}",
            chain.id
        )
    })?;
    let message = MsgUpdateClient {
        client_id: connection_details.solo_machine_client_id.to_string(),
        header: Some(any_header),
        signer: signer.to_account_address()?,
    };
    build(signer, chain, &[message], memo, request_id).await
}
pub async fn msg_update_solo_machine_client < ' e > ( executor : impl Executor < ' e , Database = Db > , signer : impl Signer , chain : & mut Chain , new_public_key : Option < & PublicKey > , memo : String , request_id : Option < & str > , ) -> Result < TxRaw > { if chain . connection_details . is_none ( ) { bail ! ( " " chain id ) ; } let sequence = chain . sequence . into ( ) ; let any_public_key = match new_public_key { Some ( new_public_key ) => new_public_key . to_any ( ) ? , None => signer . to_public_key ( ) ? . to_any ( ) ? , } ; let signature = get_header_proof ( & signer , chain , Some ( any_public_key . clone ( ) ) , chain . config . diversifier . clone ( ) , request_id , ) . await ? ; * chain = chain :: increment_sequence ( executor , & chain . id ) . await ? ; let header = SoloMachineHeader { sequence , timestamp : to_u64_timestamp ( chain . consensus_timestamp ) ? , signature , new_public_key : Some ( any_public_key ) , new_diversifier : chain . config . diversifier . clone ( ) , } ; let any_header = header . to_any ( ) ? ; let connection_details = chain . connection_details . as_ref ( ) . ok_or_else ( | | { anyhow ! ( " " chain id ) } ) ? ; let message = MsgUpdateClient { client_id : connection_details . solo_machine_client_id . to_string ( ) , header : Some ( any_header ) , signer : signer . to_account_address ( ) ? , } ; build ( signer , chain , & [ message ] , memo , request_id ) . await }
Builds a transaction to update solo machine client on IBC enabled chain
Builds a transaction to update solo machine client on IBC enabled chain
executor
impl Executor<'e, Database = Db>
signer
impl Signer
chain
&mut Chain
new_public_key
Option<&PublicKey>
memo
String
request_id
Option<&str>
executor
impl Executor<'e, Database = Db>
signer
impl Signer
chain
&mut Chain
new_public_key
Option<&PublicKey>
memo
String
request_id
Option<&str>