Skip to content

Commit

Permalink
update jsonrpsee (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasad1 authored Mar 16, 2021
1 parent b37d8ec commit 3b362fb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl<T: Runtime> ClientBuilder<T> {
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))
Expand Down
4 changes: 2 additions & 2 deletions src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ use substrate_subxt_client::SubxtClient;
#[derive(Clone)]
pub enum RpcClient {
/// JSONRPC client WebSocket transport.
WebSocket(WsClient),
WebSocket(Arc<WsClient>),
/// JSONRPC client HTTP transport.
// NOTE: Arc because `HttpClient` is not clone.
Http(Arc<HttpClient>),
Expand Down Expand Up @@ -224,7 +224,7 @@ impl RpcClient {

impl From<WsClient> for RpcClient {
fn from(client: WsClient) -> Self {
RpcClient::WebSocket(client)
RpcClient::WebSocket(Arc::new(client))
}
}

Expand Down

0 comments on commit 3b362fb

Please sign in to comment.