mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
(temporarily) Switch to jsonrpsee master (#913)
* (temporarily) switch to jsonrpsee master * removed param used for tests
This commit is contained in:
committed by
Bastian Köcher
parent
49e04b7b26
commit
5e26ba4999
@@ -10,9 +10,9 @@ bp-eth-poa = { path = "../../primitives/ethereum-poa" }
|
|||||||
codec = { package = "parity-scale-codec", version = "2.0.0" }
|
codec = { package = "parity-scale-codec", version = "2.0.0" }
|
||||||
headers-relay = { path = "../headers" }
|
headers-relay = { path = "../headers" }
|
||||||
hex-literal = "0.3"
|
hex-literal = "0.3"
|
||||||
jsonrpsee-proc-macros = "=0.2.0-alpha.3"
|
jsonrpsee-proc-macros = { git = "https://github.com/paritytech/jsonrpsee", rev = "de7b58a881512cd5ab8bbf16a56241ca808c7765" }
|
||||||
jsonrpsee-types = "=0.2.0-alpha.3"
|
jsonrpsee-types = { git = "https://github.com/paritytech/jsonrpsee", rev = "de7b58a881512cd5ab8bbf16a56241ca808c7765" }
|
||||||
jsonrpsee-ws-client = "=0.2.0-alpha.3"
|
jsonrpsee-ws-client = { git = "https://github.com/paritytech/jsonrpsee", rev = "de7b58a881512cd5ab8bbf16a56241ca808c7765" }
|
||||||
libsecp256k1 = { version = "0.3.4", default-features = false, features = ["hmac"] }
|
libsecp256k1 = { version = "0.3.4", default-features = false, features = ["hmac"] }
|
||||||
log = "0.4.11"
|
log = "0.4.11"
|
||||||
relay-utils = { path = "../utils" }
|
relay-utils = { path = "../utils" }
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ use crate::types::{
|
|||||||
};
|
};
|
||||||
use crate::{ConnectionParams, Error, Result};
|
use crate::{ConnectionParams, Error, Result};
|
||||||
|
|
||||||
use jsonrpsee_ws_client::{WsClient as RpcClient, WsConfig as RpcConfig};
|
use jsonrpsee_ws_client::{WsClient as RpcClient, WsClientBuilder as RpcClientBuilder};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
/// Number of headers missing from the Ethereum node for us to consider node not synced.
|
/// Number of headers missing from the Ethereum node for us to consider node not synced.
|
||||||
@@ -46,7 +46,7 @@ impl Client {
|
|||||||
/// Build client to use in connection.
|
/// Build client to use in connection.
|
||||||
async fn build_client(params: &ConnectionParams) -> Result<Arc<RpcClient>> {
|
async fn build_client(params: &ConnectionParams) -> Result<Arc<RpcClient>> {
|
||||||
let uri = format!("ws://{}:{}", params.host, params.port);
|
let uri = format!("ws://{}:{}", params.host, params.port);
|
||||||
let client = RpcClient::new(RpcConfig::with_url(&uri)).await?;
|
let client = RpcClientBuilder::default().build(&uri).await?;
|
||||||
Ok(Arc::new(client))
|
Ok(Arc::new(client))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
|||||||
async-std = "1.6.5"
|
async-std = "1.6.5"
|
||||||
async-trait = "0.1.40"
|
async-trait = "0.1.40"
|
||||||
codec = { package = "parity-scale-codec", version = "2.0.0" }
|
codec = { package = "parity-scale-codec", version = "2.0.0" }
|
||||||
jsonrpsee-proc-macros = "=0.2.0-alpha.3"
|
jsonrpsee-proc-macros = { git = "https://github.com/paritytech/jsonrpsee", rev = "de7b58a881512cd5ab8bbf16a56241ca808c7765" }
|
||||||
jsonrpsee-types = "=0.2.0-alpha.3"
|
jsonrpsee-types = { git = "https://github.com/paritytech/jsonrpsee", rev = "de7b58a881512cd5ab8bbf16a56241ca808c7765" }
|
||||||
jsonrpsee-ws-client = "=0.2.0-alpha.3"
|
jsonrpsee-ws-client = { git = "https://github.com/paritytech/jsonrpsee", rev = "de7b58a881512cd5ab8bbf16a56241ca808c7765" }
|
||||||
log = "0.4.11"
|
log = "0.4.11"
|
||||||
num-traits = "0.2"
|
num-traits = "0.2"
|
||||||
rand = "0.7"
|
rand = "0.7"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ use async_std::sync::{Arc, Mutex};
|
|||||||
use codec::Decode;
|
use codec::Decode;
|
||||||
use frame_system::AccountInfo;
|
use frame_system::AccountInfo;
|
||||||
use jsonrpsee_types::{jsonrpc::DeserializeOwned, traits::SubscriptionClient};
|
use jsonrpsee_types::{jsonrpc::DeserializeOwned, traits::SubscriptionClient};
|
||||||
use jsonrpsee_ws_client::{WsClient as RpcClient, WsConfig as RpcConfig, WsSubscription as Subscription};
|
use jsonrpsee_ws_client::{WsClient as RpcClient, WsClientBuilder as RpcClientBuilder, WsSubscription as Subscription};
|
||||||
use num_traits::Zero;
|
use num_traits::Zero;
|
||||||
use pallet_balances::AccountData;
|
use pallet_balances::AccountData;
|
||||||
use sp_core::{storage::StorageKey, Bytes};
|
use sp_core::{storage::StorageKey, Bytes};
|
||||||
@@ -105,9 +105,10 @@ impl<C: Chain> Client<C> {
|
|||||||
params.host,
|
params.host,
|
||||||
params.port,
|
params.port,
|
||||||
);
|
);
|
||||||
let mut config = RpcConfig::with_url(&uri);
|
let client = RpcClientBuilder::default()
|
||||||
config.max_notifs_per_subscription = MAX_SUBSCRIPTION_CAPACITY;
|
.max_notifs_per_subscription(MAX_SUBSCRIPTION_CAPACITY)
|
||||||
let client = RpcClient::new(config).await?;
|
.build(&uri)
|
||||||
|
.await?;
|
||||||
|
|
||||||
Ok(Arc::new(client))
|
Ok(Arc::new(client))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user