Upgrade jsonrpc to 0.18.0 (#9547)

* Upgrade jsonrpc to 0.18.0

I think this says all :P

* 🤦

* Fmt etc

* Fix tests

* Fix tests again...

* Better impl

* Revert "Tell dependabot to ignore jsonrpc-* updates (#9518)"

This reverts commit 6e0cd5587d.
This commit is contained in:
Bastian Köcher
2021-08-13 08:46:07 +02:00
committed by GitHub
parent 199b2883af
commit c44aba89e6
65 changed files with 1422 additions and 1291 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ description = "Substrate test utilities"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
futures = { version = "0.3.1", features = ["compat"] }
futures = "0.3.16"
substrate-test-utils-derive = { version = "0.10.0-dev", path = "./derive" }
tokio = { version = "0.2.13", features = ["macros"] }
+1 -2
View File
@@ -13,8 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "2.0.0" }
futures = "0.3.9"
futures01 = { package = "futures", version = "0.1.29" }
futures = "0.3.16"
hash-db = "0.15.2"
hex = "0.4"
serde = "1.0.126"
+6 -5
View File
@@ -307,7 +307,7 @@ pub struct RpcTransactionOutput {
/// The session object.
pub session: RpcSession,
/// An async receiver if data will be returned via a callback.
pub receiver: futures01::sync::mpsc::Receiver<String>,
pub receiver: futures::channel::mpsc::UnboundedReceiver<String>,
}
impl std::fmt::Debug for RpcTransactionOutput {
@@ -347,7 +347,7 @@ impl RpcHandlersExt for RpcHandlers {
&self,
extrinsic: OpaqueExtrinsic,
) -> Pin<Box<dyn Future<Output = Result<RpcTransactionOutput, RpcTransactionError>> + Send>> {
let (tx, rx) = futures01::sync::mpsc::channel(0);
let (tx, rx) = futures::channel::mpsc::unbounded();
let mem = RpcSession::new(tx.into());
Box::pin(
self.rpc_query(
@@ -370,7 +370,7 @@ impl RpcHandlersExt for RpcHandlers {
pub(crate) fn parse_rpc_result(
result: Option<String>,
session: RpcSession,
receiver: futures01::sync::mpsc::Receiver<String>,
receiver: futures::channel::mpsc::UnboundedReceiver<String>,
) -> Result<RpcTransactionOutput, RpcTransactionError> {
if let Some(ref result) = result {
let json: serde_json::Value =
@@ -426,8 +426,9 @@ where
mod tests {
use sc_service::RpcSession;
fn create_session_and_receiver() -> (RpcSession, futures01::sync::mpsc::Receiver<String>) {
let (tx, rx) = futures01::sync::mpsc::channel(0);
fn create_session_and_receiver(
) -> (RpcSession, futures::channel::mpsc::UnboundedReceiver<String>) {
let (tx, rx) = futures::channel::mpsc::unbounded();
let mem = RpcSession::new(tx.into());
(mem, rx)
@@ -19,5 +19,5 @@ sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain"
sp-runtime = { version = "4.0.0-dev", path = "../../../primitives/runtime" }
sc-transaction-pool = { version = "4.0.0-dev", path = "../../../client/transaction-pool", features = ["test-helpers"] }
sc-transaction-pool-api = { version = "4.0.0-dev", path = "../../../client/transaction-pool/api" }
futures = { version = "0.3.1", features = ["compat"] }
futures = "0.3.16"
derive_more = "0.99.2"
+2 -2
View File
@@ -48,8 +48,8 @@ sp-runtime-interface = { path = "../../primitives/runtime-interface" }
frame-system = { path = "../../frame/system" }
log = "0.4.8"
futures = { package = "futures", version = "0.3", features = ["compat"] }
futures = "0.3.16"
tokio = { version = "0.2", features = ["signal"] }
# Calling RPC
jsonrpc-core = "15.1"
jsonrpc-core = "18.0"
num-traits = "0.2.14"
@@ -94,7 +94,8 @@ where
+ ApiExt<T::Block, StateBackend = <TFullBackend<T::Block> as Backend<T::Block>>::State>
+ GrandpaApi<T::Block>,
<T::Runtime as frame_system::Config>::Call: From<frame_system::Call<T::Runtime>>,
<<T as ChainInfo>::Block as BlockT>::Hash: FromStr,
<<T as ChainInfo>::Block as BlockT>::Hash: FromStr + Unpin,
<<T as ChainInfo>::Block as BlockT>::Header: Unpin,
<<<T as ChainInfo>::Block as BlockT>::Header as Header>::Number:
num_traits::cast::AsPrimitive<usize>,
{