From d53338b1edd580fa1b6a47beefb34e40cb87386b Mon Sep 17 00:00:00 2001 From: Clint <141709975+clint419@users.noreply.github.com> Date: Mon, 30 Oct 2023 17:00:34 +0800 Subject: [PATCH] feat(jsonrpc): require `Sync` on transport params (#474) --- starknet-providers/src/jsonrpc/mod.rs | 4 ++-- starknet-providers/src/jsonrpc/transports/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/starknet-providers/src/jsonrpc/mod.rs b/starknet-providers/src/jsonrpc/mod.rs index 4817e3af..17b9d82b 100644 --- a/starknet-providers/src/jsonrpc/mod.rs +++ b/starknet-providers/src/jsonrpc/mod.rs @@ -30,7 +30,7 @@ pub struct JsonRpcClient { transport: T, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Copy, Serialize, Deserialize)] pub enum JsonRpcMethod { #[serde(rename = "starknet_getBlockWithTxHashes")] GetBlockWithTxHashes, @@ -177,7 +177,7 @@ where { async fn send_request(&self, method: JsonRpcMethod, params: P) -> Result where - P: Serialize + Send, + P: Serialize + Send + Sync, R: DeserializeOwned, { match self diff --git a/starknet-providers/src/jsonrpc/transports/mod.rs b/starknet-providers/src/jsonrpc/transports/mod.rs index 723d3e4b..7b119f74 100644 --- a/starknet-providers/src/jsonrpc/transports/mod.rs +++ b/starknet-providers/src/jsonrpc/transports/mod.rs @@ -20,6 +20,6 @@ pub trait JsonRpcTransport { params: P, ) -> Result, Self::Error> where - P: Serialize + Send, + P: Serialize + Send + Sync, R: DeserializeOwned; }