From 0549f73de2f1e85017f922b78fad6f868b8ea0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Thu, 14 Dec 2023 10:39:01 +0000 Subject: [PATCH 1/2] made rpc::Client and SubscriptionClient traits conditionally ?Send --- rpc/src/client.rs | 3 ++- rpc/src/client/subscription.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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; From 89b7de0bbe7ca8da74b8769a1bdfe528a19466ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Thu, 14 Dec 2023 10:44:41 +0000 Subject: [PATCH 2/2] updated changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) 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