update jsonrpsee (#251)

This commit is contained in:
Niklas Adolfsson
2021-03-16 17:00:32 +01:00
committed by GitHub
parent b37d8ecd5a
commit 3b362fb072
4 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -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))
+2 -2
View File
@@ -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>),
@@ -224,7 +224,7 @@ impl RpcClient {
impl From<WsClient> for RpcClient {
fn from(client: WsClient) -> Self {
RpcClient::WebSocket(client)
RpcClient::WebSocket(Arc::new(client))
}
}