diff --git a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/query_client.rs b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/query_client.rs index 0a135376431..80af295644a 100644 --- a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/query_client.rs +++ b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/query_client.rs @@ -28,7 +28,7 @@ use cosmrs::proto::cosmwasm::wasm::v1::{ QueryRawContractStateResponse, QuerySmartContractStateRequest, QuerySmartContractStateResponse, }; use cosmrs::tendermint::{block, chain, Hash}; -use cosmrs::{AccountId, Coin as CosmosCoin, Tx}; +use cosmrs::{AccountId, Coin as CosmosCoin}; use prost::Message; use serde::{Deserialize, Serialize}; @@ -556,23 +556,12 @@ pub trait CosmWasmClient: TendermintRpcClient { Ok(serde_json::from_slice(&res.data)?) } - // deprecation warning is due to the fact the protobuf files built were based on cosmos-sdk 0.44, - // where they prefer using tx_bytes directly. However, in 0.42, which we are using at the time - // of writing this, the option does not work - // TODO: we should really stop using the `tx` argument here and use `tx_bytes` exlusively, - // however, at the time of writing this update, while our QA and mainnet networks do support it, - // sandbox is still running old version of wasmd that lacks support for `tx_bytes` - #[allow(deprecated)] - async fn query_simulate( - &self, - tx: Option, - tx_bytes: Vec, - ) -> Result { + async fn query_simulate(&self, tx_bytes: Vec) -> Result { let path = Some("/cosmos.tx.v1beta1.Service/Simulate".to_owned()); let req = SimulateRequest { - tx: tx.map(Into::into), tx_bytes, + ..Default::default() }; let res = self diff --git a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/signing_client.rs b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/signing_client.rs index cec29e9c50e..e59046af7b6 100644 --- a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/signing_client.rs +++ b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/signing_client.rs @@ -81,17 +81,14 @@ where auth_info: single_unspecified_signer_auth(public_key, sequence_response.sequence), signatures: vec![Vec::new()], }; - self.query_simulate(Some(partial_tx), Vec::new()).await - - // for completion sake, once we're able to transition into using `tx_bytes`, - // we might want to use something like this instead: - // let tx_raw: tx::Raw = cosmrs::proto::cosmos::tx::v1beta1::TxRaw { - // body_bytes: partial_tx.body.into_bytes().unwrap(), - // auth_info_bytes: partial_tx.auth_info.into_bytes().unwrap(), - // signatures: partial_tx.signatures, - // } - // .into(); - // self.query_simulate(None, tx_raw.to_bytes().unwrap()).await + + let tx_raw: tx::Raw = cosmrs::proto::cosmos::tx::v1beta1::TxRaw { + body_bytes: partial_tx.body.into_bytes()?, + auth_info_bytes: partial_tx.auth_info.into_bytes()?, + signatures: partial_tx.signatures, + } + .into(); + self.query_simulate(tx_raw.to_bytes()?).await } async fn upload(