From 38cdd0a5c64789a1bce8183a66e223262c716544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Tue, 8 Jan 2019 14:46:07 +0100 Subject: [PATCH] Bump jsonrpc to fix hang on exit (#1367) * Test RPC fix. * Fix meta in unsubscribe. * Fix meta in unsubscribe. --- substrate/Cargo.lock | 12 ++++++------ substrate/core/rpc/src/author/mod.rs | 4 ++-- substrate/core/rpc/src/chain/mod.rs | 8 ++++---- substrate/core/rpc/src/state/mod.rs | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/substrate/Cargo.lock b/substrate/Cargo.lock index 678f3e4154..1e242a9aeb 100644 --- a/substrate/Cargo.lock +++ b/substrate/Cargo.lock @@ -1088,7 +1088,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "jsonrpc-core" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#3604d9990f051b8b440961b0877a46140bb87a50" +source = "git+https://github.com/paritytech/jsonrpc.git#0227e70fdce25cad9c71be222dc9e7f754c08033" dependencies = [ "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1100,7 +1100,7 @@ dependencies = [ [[package]] name = "jsonrpc-http-server" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#3604d9990f051b8b440961b0877a46140bb87a50" +source = "git+https://github.com/paritytech/jsonrpc.git#0227e70fdce25cad9c71be222dc9e7f754c08033" dependencies = [ "hyper 0.12.19 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", @@ -1113,7 +1113,7 @@ dependencies = [ [[package]] name = "jsonrpc-macros" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#3604d9990f051b8b440961b0877a46140bb87a50" +source = "git+https://github.com/paritytech/jsonrpc.git#0227e70fdce25cad9c71be222dc9e7f754c08033" dependencies = [ "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "jsonrpc-pubsub 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", @@ -1123,7 +1123,7 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#3604d9990f051b8b440961b0877a46140bb87a50" +source = "git+https://github.com/paritytech/jsonrpc.git#0227e70fdce25cad9c71be222dc9e7f754c08033" dependencies = [ "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1133,7 +1133,7 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#3604d9990f051b8b440961b0877a46140bb87a50" +source = "git+https://github.com/paritytech/jsonrpc.git#0227e70fdce25cad9c71be222dc9e7f754c08033" dependencies = [ "bytes 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1149,7 +1149,7 @@ dependencies = [ [[package]] name = "jsonrpc-ws-server" version = "9.0.0" -source = "git+https://github.com/paritytech/jsonrpc.git#3604d9990f051b8b440961b0877a46140bb87a50" +source = "git+https://github.com/paritytech/jsonrpc.git#0227e70fdce25cad9c71be222dc9e7f754c08033" dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 9.0.0 (git+https://github.com/paritytech/jsonrpc.git)", diff --git a/substrate/core/rpc/src/author/mod.rs b/substrate/core/rpc/src/author/mod.rs index 7e26035525..be86487509 100644 --- a/substrate/core/rpc/src/author/mod.rs +++ b/substrate/core/rpc/src/author/mod.rs @@ -64,7 +64,7 @@ build_rpc_trait! { /// Unsubscribe from extrinsic watching. #[rpc(name = "author_unwatchExtrinsic")] - fn unwatch_extrinsic(&self, Self::Metadata, SubscriptionId) -> Result; + fn unwatch_extrinsic(&self, Option, SubscriptionId) -> Result; } } @@ -149,7 +149,7 @@ impl AuthorApi, BlockHash

> for Author whe }) } - fn unwatch_extrinsic(&self, _metadata: Self::Metadata, id: SubscriptionId) -> Result { + fn unwatch_extrinsic(&self, _metadata: Option, id: SubscriptionId) -> Result { Ok(self.subscriptions.cancel(id)) } } diff --git a/substrate/core/rpc/src/chain/mod.rs b/substrate/core/rpc/src/chain/mod.rs index c4e0899fa1..3f57bfe6fc 100644 --- a/substrate/core/rpc/src/chain/mod.rs +++ b/substrate/core/rpc/src/chain/mod.rs @@ -65,7 +65,7 @@ build_rpc_trait! { /// Unsubscribe from new head subscription. #[rpc(name = "chain_unsubscribeNewHead", alias = ["unsubscribe_newHead", ])] - fn unsubscribe_new_head(&self, Self::Metadata, SubscriptionId) -> RpcResult; + fn unsubscribe_new_head(&self, Option, SubscriptionId) -> RpcResult; } #[pubsub(name = "chain_finalisedHead")] { @@ -75,7 +75,7 @@ build_rpc_trait! { /// Unsubscribe from new head subscription. #[rpc(name = "chain_unsubscribeFinalisedHeads")] - fn unsubscribe_finalised_heads(&self, Self::Metadata, SubscriptionId) -> RpcResult; + fn unsubscribe_finalised_heads(&self, Option, SubscriptionId) -> RpcResult; } } } @@ -189,7 +189,7 @@ impl ChainApi, Sig ) } - fn unsubscribe_new_head(&self, _metadata: Self::Metadata, id: SubscriptionId) -> RpcResult { + fn unsubscribe_new_head(&self, _metadata: Option, id: SubscriptionId) -> RpcResult { Ok(self.subscriptions.cancel(id)) } @@ -202,7 +202,7 @@ impl ChainApi, Sig ) } - fn unsubscribe_finalised_heads(&self, _metadata: Self::Metadata, id: SubscriptionId) -> RpcResult { + fn unsubscribe_finalised_heads(&self, _metadata: Option, id: SubscriptionId) -> RpcResult { Ok(self.subscriptions.cancel(id)) } } diff --git a/substrate/core/rpc/src/state/mod.rs b/substrate/core/rpc/src/state/mod.rs index 19f4046aa8..209fe5bb3a 100644 --- a/substrate/core/rpc/src/state/mod.rs +++ b/substrate/core/rpc/src/state/mod.rs @@ -85,7 +85,7 @@ build_rpc_trait! { /// Unsubscribe from runtime version subscription #[rpc(name = "state_unsubscribeRuntimeVersion", alias = ["chain_unsubscribeRuntimeVersion", ])] - fn unsubscribe_runtime_version(&self, Self::Metadata, SubscriptionId) -> RpcResult; + fn unsubscribe_runtime_version(&self, Option, SubscriptionId) -> RpcResult; } #[pubsub(name = "state_storage")] { @@ -95,7 +95,7 @@ build_rpc_trait! { /// Unsubscribe from storage subscription #[rpc(name = "state_unsubscribeStorage")] - fn unsubscribe_storage(&self, Self::Metadata, SubscriptionId) -> RpcResult; + fn unsubscribe_storage(&self, Option, SubscriptionId) -> RpcResult; } } } @@ -281,7 +281,7 @@ impl StateApi for State where }) } - fn unsubscribe_storage(&self, _meta: Self::Metadata, id: SubscriptionId) -> RpcResult { + fn unsubscribe_storage(&self, _meta: Option, id: SubscriptionId) -> RpcResult { Ok(self.subscriptions.cancel(id)) } @@ -333,7 +333,7 @@ impl StateApi for State where }); } - fn unsubscribe_runtime_version(&self, _meta: Self::Metadata, id: SubscriptionId) -> RpcResult { + fn unsubscribe_runtime_version(&self, _meta: Option, id: SubscriptionId) -> RpcResult { Ok(self.subscriptions.cancel(id)) } }