diff --git a/Cargo.toml b/Cargo.toml index e331563208..77c22ced10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,9 +24,9 @@ client = ["substrate-subxt-client"] log = "0.4.13" thiserror = "1.0.23" futures = "0.3.10" -jsonrpsee-types = "0.2.0-alpha.2" -jsonrpsee-ws-client = "0.2.0-alpha.2" -jsonrpsee-http-client = "0.2.0-alpha.2" +jsonrpsee-types = "=0.2.0-alpha.3" +jsonrpsee-ws-client = "=0.2.0-alpha.3" +jsonrpsee-http-client = "=0.2.0-alpha.3" num-traits = { version = "0.2.14", default-features = false } serde = { version = "1.0.119", features = ["derive"] } serde_json = "1.0.61" diff --git a/client/Cargo.toml b/client/Cargo.toml index d0488a3e8c..ef5cd73e6a 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -15,8 +15,8 @@ keywords = ["parity", "substrate", "blockchain"] async-std = "1.8.0" futures = { version = "0.3.9", features = ["compat"], package = "futures" } futures01 = { package = "futures", version = "0.1.29" } -jsonrpsee-types = "0.2.0-alpha" -jsonrpsee-ws-client = "0.2.0-alpha" +jsonrpsee-types = "=0.2.0-alpha.3" +jsonrpsee-ws-client = "=0.2.0-alpha.3" log = "0.4.13" sc-network = { version = "0.9.0", default-features = false } sc-client-db = "0.9.0" diff --git a/src/lib.rs b/src/lib.rs index f1986cee7d..206dd662b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -212,7 +212,7 @@ impl ClientBuilder { if url.starts_with("ws://") || url.starts_with("wss://") { let mut config = WsConfig::with_url(&url); config.max_notifs_per_subscription = 4096; - RpcClient::WebSocket(WsClient::new(config).await?) + RpcClient::WebSocket(Arc::new(WsClient::new(config).await?)) } else { let client = HttpClient::new(url, HttpConfig::default())?; RpcClient::Http(Arc::new(client)) diff --git a/src/rpc.rs b/src/rpc.rs index 3a2f5af9a3..20de9b1ac8 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -165,7 +165,7 @@ use substrate_subxt_client::SubxtClient; #[derive(Clone)] pub enum RpcClient { /// JSONRPC client WebSocket transport. - WebSocket(WsClient), + WebSocket(Arc), /// JSONRPC client HTTP transport. // NOTE: Arc because `HttpClient` is not clone. Http(Arc), @@ -224,7 +224,7 @@ impl RpcClient { impl From for RpcClient { fn from(client: WsClient) -> Self { - RpcClient::WebSocket(client) + RpcClient::WebSocket(Arc::new(client)) } }