Skip to content

Commit

Permalink
fix wasm builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mariocynicys committed Mar 14, 2024
1 parent 96e914c commit a74eb1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion mm2src/coins/tendermint/rpc/tendermint_native_rpc.rs
Expand Up @@ -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)
}
}

Expand Down
10 changes: 4 additions & 6 deletions 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};
Expand Down Expand Up @@ -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<R>(&self, request: R) -> Result<R::Response, PerformError>
pub(crate) async fn perform<R>(&self, request: R) -> Result<R::Output, PerformError>
where
R: SimpleRequest,
{
Expand All @@ -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.
Expand All @@ -92,7 +90,7 @@ impl HttpClient {
/// `/abci_query`: query the ABCI application
pub async fn abci_query<V>(
&self,
path: Option<AbciPath>,
path: Option<String>,
data: V,
height: Option<Height>,
prove: bool,
Expand All @@ -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<broadcast::tx_commit::Response, PerformError> {
pub async fn broadcast_tx_commit(&self, tx: Vec<u8>) -> Result<broadcast::tx_commit::Response, PerformError> {
self.perform(broadcast::tx_commit::Request::new(tx)).await
}
}
Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/z_coin/z_rpc.rs
Expand Up @@ -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);
Expand Down

0 comments on commit a74eb1c

Please sign in to comment.