companion for #12663 jsonrpsee v0.16 (#1905)

* companion for #12663 jsonrpsee v0.16.1

* update deps

* update rpc client params

* update substrate and polkadot
This commit is contained in:
Niklas Adolfsson
2022-12-12 13:23:01 +01:00
committed by GitHub
parent 541dd3e228
commit acac823a7a
7 changed files with 358 additions and 337 deletions
+338 -321
View File
File diff suppressed because it is too large Load Diff
@@ -18,5 +18,5 @@ sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "mas
futures = "0.3.25"
async-trait = "0.1.59"
thiserror = "1.0.37"
jsonrpsee-core = "0.15.1"
jsonrpsee-core = "0.16.2"
parity-scale-codec = "3.2.1"
@@ -25,7 +25,7 @@ tokio = { version = "1.22.0", features = ["sync"] }
futures = "0.3.25"
futures-timer = "3.0.2"
parity-scale-codec = "3.2.1"
jsonrpsee = { version = "0.15.1", features = ["ws-client"] }
jsonrpsee = { version = "0.16.2", features = ["ws-client"] }
tracing = "0.1.37"
async-trait = "0.1.59"
url = "2.3.1"
@@ -35,10 +35,10 @@ use futures::{
use jsonrpsee::{
core::{
client::{Client as JsonRpcClient, ClientT, Subscription, SubscriptionClientT},
params::ArrayParams,
Error as JsonRpseeError,
},
rpc_params,
types::ParamsSer,
ws_client::WsClientBuilder,
};
use parity_scale_codec::{Decode, Encode};
@@ -264,7 +264,7 @@ impl RelayChainRpcClient {
async fn request<'a, R>(
&self,
method: &'a str,
params: Option<ParamsSer<'a>>,
params: ArrayParams,
) -> Result<R, RelayChainError>
where
R: DeserializeOwned + std::fmt::Debug,
@@ -281,7 +281,7 @@ impl RelayChainRpcClient {
async fn request_tracing<'a, R, OR>(
&self,
method: &'a str,
params: Option<ParamsSer<'a>>,
params: ArrayParams,
trace_error: OR,
) -> Result<R, RelayChainError>
where
@@ -359,12 +359,12 @@ impl RelayChainRpcClient {
/// Get local listen address of the node
pub async fn system_local_listen_addresses(&self) -> Result<Vec<String>, RelayChainError> {
self.request("system_localListenAddresses", None).await
self.request("system_localListenAddresses", rpc_params![]).await
}
/// Get system health information
pub async fn system_health(&self) -> Result<Health, RelayChainError> {
self.request("system_health", None).await
self.request("system_health", rpc_params![]).await
}
/// Get read proof for `storage_keys`
@@ -449,7 +449,7 @@ impl RelayChainRpcClient {
/// Get hash of last finalized block.
pub async fn chain_get_finalized_head(&self) -> Result<PHash, RelayChainError> {
self.request("chain_getFinalizedHead", None).await
self.request("chain_getFinalizedHead", rpc_params![]).await
}
/// Get hash of n-th block.
@@ -680,7 +680,11 @@ impl RelayChainRpcClient {
ws_client: &JsonRpcClient,
) -> Result<Subscription<PHeader>, RelayChainError> {
Ok(ws_client
.subscribe::<PHeader>("chain_subscribeAllHeads", None, "chain_unsubscribeAllHeads")
.subscribe::<PHeader, _>(
"chain_subscribeAllHeads",
rpc_params![],
"chain_unsubscribeAllHeads",
)
.await?)
}
@@ -688,9 +692,9 @@ impl RelayChainRpcClient {
ws_client: &JsonRpcClient,
) -> Result<Subscription<PHeader>, RelayChainError> {
Ok(ws_client
.subscribe::<PHeader>(
.subscribe::<PHeader, _>(
"chain_subscribeFinalizedHeads",
None,
rpc_params![],
"chain_unsubscribeFinalizedHeads",
)
.await?)
@@ -700,9 +704,9 @@ impl RelayChainRpcClient {
ws_client: &JsonRpcClient,
) -> Result<Subscription<PHeader>, RelayChainError> {
Ok(ws_client
.subscribe::<PHeader>(
.subscribe::<PHeader, _>(
"chain_subscribeNewHeads",
None,
rpc_params![],
"chain_unsubscribeFinalizedHeads",
)
.await?)
+1 -1
View File
@@ -14,7 +14,7 @@ clap = { version = "4.0.29", features = ["derive"] }
log = "0.4.17"
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.149", features = ["derive"] }
jsonrpsee = { version = "0.15.1", features = ["server"] }
jsonrpsee = { version = "0.16.2", features = ["server"] }
# Local
parachain-template-runtime = { path = "../runtime" }
+1 -1
View File
@@ -31,7 +31,7 @@ contracts-rococo-runtime = { path = "../parachains/runtimes/contracts/contracts-
bridge-hub-rococo-runtime = { path = "../parachains/runtimes/bridge-hubs/bridge-hub-rococo" }
bridge-hub-kusama-runtime = { path = "../parachains/runtimes/bridge-hubs/bridge-hub-kusama" }
penpal-runtime = { path = "../parachains/runtimes/testing/penpal" }
jsonrpsee = { version = "0.15.1", features = ["server"] }
jsonrpsee = { version = "0.16.2", features = ["server"] }
parachains-common = { path = "../parachains/common" }
# Substrate
+1 -1
View File
@@ -13,7 +13,7 @@ async-trait = "0.1.59"
clap = { version = "4.0.29", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
criterion = { version = "0.4.0", features = [ "async_tokio" ] }
jsonrpsee = { version = "0.15.1", features = ["server"] }
jsonrpsee = { version = "0.16.2", features = ["server"] }
rand = "0.8.5"
serde = { version = "1.0.149", features = ["derive"] }
tokio = { version = "1.22.0", features = ["macros"] }