companion PR for #5732: pubsub RPC for grandpa justifications (#1346)

* Companion PR for #5732

Add subscription RPC for listening on GRANDPA justifications.

* grandpa-rpc: some merge fixes

* "Update Substrate"

Co-authored-by: parity-processbot <>
This commit is contained in:
Jon Häggblad
2020-08-10 12:57:42 +02:00
committed by GitHub
parent f6f80ece18
commit 0ed8cad3c3
5 changed files with 162 additions and 141 deletions
+5 -2
View File
@@ -127,7 +127,7 @@ 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::RpcExtension,
impl Fn(polkadot_rpc::DenyUnsafe, polkadot_rpc::SubscriptionManager) -> polkadot_rpc::RpcExtension,
(
babe::BabeBlockImport<
Block, FullClient<RuntimeApi, Executor>, FullGrandpaBlockImport<RuntimeApi, Executor>
@@ -202,6 +202,7 @@ pub fn new_partial<RuntimeApi, Executor>(config: &mut Configuration, test: bool)
config.prometheus_registry(),
)?;
let justification_stream = grandpa_link.justification_stream();
let shared_authority_set = grandpa_link.shared_authority_set().clone();
let shared_voter_state = grandpa::SharedVoterState::empty();
@@ -217,7 +218,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| -> polkadot_rpc::RpcExtension {
move |deny_unsafe, subscriptions| -> polkadot_rpc::RpcExtension {
let deps = polkadot_rpc::FullDeps {
client: client.clone(),
pool: transaction_pool.clone(),
@@ -231,6 +232,8 @@ pub fn new_partial<RuntimeApi, Executor>(config: &mut Configuration, test: bool)
grandpa: polkadot_rpc::GrandpaDeps {
shared_voter_state: shared_voter_state.clone(),
shared_authority_set: shared_authority_set.clone(),
justification_stream: justification_stream.clone(),
subscriptions,
},
};