Skip to content

Commit

Permalink
rpc: Make rpc::Client and SubscriptionClient traits ?Send under…
Browse files Browse the repository at this point in the history
… `wasm32` target (informalsystems#1386)

* made rpc::Client and SubscriptionClient traits conditionally ?Send

* updated changelog
  • Loading branch information
jstuczyn authored Dec 18, 2023
1 parent a21b245 commit 2499bad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion rpc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<abci::response::Info, Error> {
Expand Down
3 changes: 2 additions & 1 deletion rpc/src/client/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Subscription, Error>;
Expand Down

0 comments on commit 2499bad

Please sign in to comment.