Unverified Commit 9892aef7 authored by Jon Häggblad's avatar Jon Häggblad Committed by GitHub
Browse files

Companion PR for #7039: grandpa-rpc dont share subscription manager, only executor (#1687)



* grandpa-rpc: dont share subscription manager, only executor

* node/rpc: merge imports

* node: apply style fixes from code review

* "Update Substrate"

Co-authored-by: default avatarAndré Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: parity-processbot <>
Co-authored-by: default avatarAndré Silva <andrerfosilva@gmail.com>
parent 56ca3bb9
Pipeline #106638 canceled with stages
in 5 minutes and 10 seconds
This diff is collapsed.
......@@ -158,7 +158,10 @@ fn new_partial<RuntimeApi, Executor>(config: &mut Configuration) -> Result<
consensus_common::DefaultImportQueue<Block, FullClient<RuntimeApi, Executor>>,
sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, Executor>>,
(
impl Fn(polkadot_rpc::DenyUnsafe, polkadot_rpc::SubscriptionManager) -> polkadot_rpc::RpcExtension,
impl Fn(
polkadot_rpc::DenyUnsafe,
polkadot_rpc::SubscriptionTaskExecutor,
) -> polkadot_rpc::RpcExtension,
(
babe::BabeBlockImport<
Block, FullClient<RuntimeApi, Executor>, FullGrandpaBlockImport<RuntimeApi, Executor>
......@@ -245,7 +248,7 @@ fn new_partial<RuntimeApi, Executor>(config: &mut Configuration) -> Result<
let transaction_pool = transaction_pool.clone();
let select_chain = select_chain.clone();
move |deny_unsafe, subscriptions| -> polkadot_rpc::RpcExtension {
move |deny_unsafe, subscription_executor| -> polkadot_rpc::RpcExtension {
let deps = polkadot_rpc::FullDeps {
client: client.clone(),
pool: transaction_pool.clone(),
......@@ -260,7 +263,7 @@ fn new_partial<RuntimeApi, Executor>(config: &mut Configuration) -> Result<
shared_voter_state: shared_voter_state.clone(),
shared_authority_set: shared_authority_set.clone(),
justification_stream: justification_stream.clone(),
subscriptions,
subscription_executor,
},
};
......
......@@ -6,7 +6,6 @@ edition = "2018"
[dependencies]
jsonrpc-core = "14.0.3"
jsonrpc-pubsub = "14.0.3"
polkadot-primitives = { path = "../primitives" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
......
......@@ -29,8 +29,7 @@ use sp_consensus_babe::BabeApi;
use sc_client_api::light::{Fetcher, RemoteBlockchain};
use sc_consensus_babe::Epoch;
use sp_block_builder::BlockBuilder;
pub use sc_rpc::DenyUnsafe;
pub use jsonrpc_pubsub::manager::SubscriptionManager;
pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor};
/// A type representing all RPC extensions.
pub type RpcExtension = jsonrpc_core::IoHandler<sc_rpc::Metadata>;
......@@ -66,7 +65,7 @@ pub struct GrandpaDeps {
/// Receives notifications about justification events from Grandpa.
pub justification_stream: sc_finality_grandpa::GrandpaJustificationStream<Block>,
/// Subscription manager to keep track of pubsub subscribers.
pub subscriptions: jsonrpc_pubsub::manager::SubscriptionManager,
pub subscription_executor: sc_rpc::SubscriptionTaskExecutor,
}
/// Full client dependencies
......@@ -120,7 +119,7 @@ pub fn create_full<C, P, SC>(deps: FullDeps<C, P, SC>) -> RpcExtension where
shared_voter_state,
shared_authority_set,
justification_stream,
subscriptions,
subscription_executor,
} = grandpa;
io.extend_with(
......@@ -146,7 +145,7 @@ pub fn create_full<C, P, SC>(deps: FullDeps<C, P, SC>) -> RpcExtension where
shared_authority_set,
shared_voter_state,
justification_stream,
subscriptions,
subscription_executor,
))
);
io
......
......@@ -121,7 +121,10 @@ pub fn new_partial<RuntimeApi, Executor>(config: &mut Configuration, test: bool)
consensus_common::DefaultImportQueue<Block, FullClient<RuntimeApi, Executor>>,
sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, Executor>>,
(
impl Fn(polkadot_rpc::DenyUnsafe, polkadot_rpc::SubscriptionManager) -> polkadot_rpc::RpcExtension,
impl Fn(
polkadot_rpc::DenyUnsafe,
polkadot_rpc::SubscriptionTaskExecutor,
) -> polkadot_rpc::RpcExtension,
(
babe::BabeBlockImport<
Block, FullClient<RuntimeApi, Executor>, FullGrandpaBlockImport<RuntimeApi, Executor>
......@@ -213,7 +216,7 @@ pub fn new_partial<RuntimeApi, Executor>(config: &mut Configuration, test: bool)
let transaction_pool = transaction_pool.clone();
let select_chain = select_chain.clone();
move |deny_unsafe, subscriptions| -> polkadot_rpc::RpcExtension {
move |deny_unsafe, subscription_executor| -> polkadot_rpc::RpcExtension {
let deps = polkadot_rpc::FullDeps {
client: client.clone(),
pool: transaction_pool.clone(),
......@@ -228,7 +231,7 @@ pub fn new_partial<RuntimeApi, Executor>(config: &mut Configuration, test: bool)
shared_voter_state: shared_voter_state.clone(),
shared_authority_set: shared_authority_set.clone(),
justification_stream: justification_stream.clone(),
subscriptions,
subscription_executor,
},
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment