diff --git a/CHANGELOG.md b/CHANGELOG.md index 56c467ca0..ea263ea73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,8 @@ Support for Secp256k1 consensus keys has been added as an optional feature. - `[tendermint-rpc]` Turn non-200 HTTP response into an error instead of trying to parse the body as a JSON-RPC response ([\#1359](https://github.com/informalsystems/tendermint-rs/issues/1359)) +- `[tendermint-rpc]` Make `rpc::Client` and `SubscriptionClient` traits `?Send` under `wasm32` target. + ([\#1385](https://github.com/informalsystems/tendermint-rs/issues/1385)) ### SECURITY diff --git a/rpc/src/client.rs b/rpc/src/client.rs index 523a32d1c..b90472281 100644 --- a/rpc/src/client.rs +++ b/rpc/src/client.rs @@ -45,7 +45,8 @@ use crate::{ /// [`SubscriptionClient`] trait. /// /// [`SubscriptionClient`]: trait.SubscriptionClient.html -#[async_trait] +#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] pub trait Client { /// `/abci_info`: get information about the ABCI application. async fn abci_info(&self) -> Result { diff --git a/rpc/src/client/subscription.rs b/rpc/src/client/subscription.rs index d530adf4a..1686ebd67 100644 --- a/rpc/src/client/subscription.rs +++ b/rpc/src/client/subscription.rs @@ -19,7 +19,8 @@ use crate::{ /// A client that exclusively provides [`Event`] subscription capabilities, /// without any other RPC method support. -#[async_trait] +#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] pub trait SubscriptionClient { /// `/subscribe`: subscribe to receive events produced by the given query. async fn subscribe(&self, query: Query) -> Result;