Upgrade remote-externalities to use jsonrpsee v0.3 (#9342)

This commit is contained in:
David
2021-07-13 22:01:36 +02:00
committed by GitHub
parent d1ebd9841e
commit f5da2ecbeb
4 changed files with 76 additions and 18 deletions
@@ -34,7 +34,7 @@ use sp_core::{
use codec::{Encode, Decode};
use sp_runtime::traits::Block as BlockT;
use jsonrpsee_ws_client::{
WsClientBuilder, WsClient, v2::params::JsonRpcParams,
WsClientBuilder, WsClient, types::v2::params::JsonRpcParams,
};
pub mod rpc_api;
@@ -275,7 +275,7 @@ impl<B: BlockT> Builder<B> {
prefix: StorageKey,
at: B::Hash,
) -> Result<Vec<KeyPair>, &'static str> {
use jsonrpsee_ws_client::traits::Client;
use jsonrpsee_ws_client::types::traits::Client;
use serde_json::to_value;
let keys = self.get_keys_paged(prefix, at).await?;
let keys_count = keys.len();
@@ -19,7 +19,14 @@
// TODO: Consolidate one off RPC calls https://github.com/paritytech/substrate/issues/8988
use sp_runtime::{generic::SignedBlock, traits::{Block as BlockT, Header as HeaderT}};
use jsonrpsee_ws_client::{WsClientBuilder, WsClient, v2::params::JsonRpcParams, traits::Client};
use jsonrpsee_ws_client::{
WsClientBuilder,
WsClient,
types::{
v2::params::JsonRpcParams,
traits::Client
},
};
/// Get the header of the block identified by `at`
pub async fn get_header<Block, S>(from: S, at: Block::Hash) -> Result<Block::Header, String>