From a74eb1c5eeb6a1a470f51c6545eb5187eeaf1fd0 Mon Sep 17 00:00:00 2001 From: Omer Yacine Date: Thu, 14 Mar 2024 10:21:54 +0200 Subject: [PATCH] fix wasm builds --- mm2src/coins/tendermint/rpc/tendermint_native_rpc.rs | 2 +- mm2src/coins/tendermint/rpc/tendermint_wasm_rpc.rs | 10 ++++------ mm2src/coins/z_coin/z_rpc.rs | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/mm2src/coins/tendermint/rpc/tendermint_native_rpc.rs b/mm2src/coins/tendermint/rpc/tendermint_native_rpc.rs index 5f00d59cfa..48a5ecef0b 100644 --- a/mm2src/coins/tendermint/rpc/tendermint_native_rpc.rs +++ b/mm2src/coins/tendermint/rpc/tendermint_native_rpc.rs @@ -319,7 +319,7 @@ impl Client for HttpClient { where R: SimpleRequest, { - self.inner.perform(request).await.map(R::Output::from) + self.inner.perform(request).await.map(From::from) } } diff --git a/mm2src/coins/tendermint/rpc/tendermint_wasm_rpc.rs b/mm2src/coins/tendermint/rpc/tendermint_wasm_rpc.rs index 1eca9556ee..0e5b54d09c 100644 --- a/mm2src/coins/tendermint/rpc/tendermint_wasm_rpc.rs +++ b/mm2src/coins/tendermint/rpc/tendermint_wasm_rpc.rs @@ -1,6 +1,4 @@ use common::APPLICATION_JSON; -pub use cosmrs::tendermint::abci::Path as AbciPath; -use cosmrs::tendermint::abci::Transaction; use cosmrs::tendermint::block::Height; use derive_more::Display; use http::header::{ACCEPT, CONTENT_TYPE}; @@ -61,7 +59,7 @@ impl HttpClient { #[inline] pub fn uri(&self) -> http::Uri { Uri::from_str(&self.uri).expect("This should never happen.") } - pub(crate) async fn perform(&self, request: R) -> Result + pub(crate) async fn perform(&self, request: R) -> Result where R: SimpleRequest, { @@ -80,7 +78,7 @@ impl HttpClient { response: response_str, }); } - Ok(R::Response::from_string(response_str)?) + Ok(R::Response::from_string(response_str)?.into()) } /// `/abci_info`: get information about the ABCI application. @@ -92,7 +90,7 @@ impl HttpClient { /// `/abci_query`: query the ABCI application pub async fn abci_query( &self, - path: Option, + path: Option, data: V, height: Option, prove: bool, @@ -108,7 +106,7 @@ impl HttpClient { /// `/broadcast_tx_commit`: broadcast a transaction, returning the response /// from `DeliverTx`. - pub async fn broadcast_tx_commit(&self, tx: Transaction) -> Result { + pub async fn broadcast_tx_commit(&self, tx: Vec) -> Result { self.perform(broadcast::tx_commit::Request::new(tx)).await } } diff --git a/mm2src/coins/z_coin/z_rpc.rs b/mm2src/coins/z_coin/z_rpc.rs index 98571ae579..31fb0c8cd3 100644 --- a/mm2src/coins/z_coin/z_rpc.rs +++ b/mm2src/coins/z_coin/z_rpc.rs @@ -141,7 +141,7 @@ impl LightRpcClient { }; cfg_wasm32!( - let client = CompactTxStreamerClient::new(TonicClient::new(url.to_string())).accept_gzip(); + let client = CompactTxStreamerClient::new(TonicClient::new(url.to_string())).accept_compressed(CompressionEncoding::Gzip); ); rpc_clients.push(client);