mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 12:17:58 +00:00
grandpa-rpc don't share subscription manager, only executor (#7039)
* service builder: fix todo about jsonrpc Option workaround * grandpa-rpc: only share executor instead of sub manager * grandpa-rpc: fix compilation * grandpa-rpc: rename to subscription_executor * node/cli: remove another unused jsonrpc dependency * grandpa: apply style fixes from code review Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
@@ -12,7 +12,6 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
jsonrpc-core = "14.2.0"
|
||||
jsonrpc-pubsub = "14.2.0"
|
||||
node-primitives = { version = "2.0.0-rc6", path = "../primitives" }
|
||||
node-runtime = { version = "2.0.0-rc6", path = "../runtime" }
|
||||
pallet-contracts-rpc = { version = "0.8.0-rc6", path = "../../../frame/contracts/rpc/" }
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use jsonrpc_pubsub::manager::SubscriptionManager;
|
||||
use node_primitives::{Block, BlockNumber, AccountId, Index, Balance, Hash};
|
||||
use sc_consensus_babe::{Config, Epoch};
|
||||
use sc_consensus_babe_rpc::BabeRpcHandler;
|
||||
@@ -46,6 +45,7 @@ use sp_block_builder::BlockBuilder;
|
||||
use sp_blockchain::{Error as BlockChainError, HeaderMetadata, HeaderBackend};
|
||||
use sp_consensus::SelectChain;
|
||||
use sp_consensus_babe::BabeApi;
|
||||
use sc_rpc::SubscriptionTaskExecutor;
|
||||
use sp_transaction_pool::TransactionPool;
|
||||
|
||||
/// Light client extra dependencies.
|
||||
@@ -78,8 +78,8 @@ pub struct GrandpaDeps {
|
||||
pub shared_authority_set: SharedAuthoritySet<Hash, BlockNumber>,
|
||||
/// Receives notifications about justification events from Grandpa.
|
||||
pub justification_stream: GrandpaJustificationStream<Block>,
|
||||
/// Subscription manager to keep track of pubsub subscribers.
|
||||
pub subscriptions: SubscriptionManager,
|
||||
/// Executor to drive the subscription manager in the Grandpa RPC handler.
|
||||
pub subscription_executor: SubscriptionTaskExecutor,
|
||||
}
|
||||
|
||||
/// Full client dependencies.
|
||||
@@ -139,7 +139,7 @@ pub fn create_full<C, P, SC>(
|
||||
shared_voter_state,
|
||||
shared_authority_set,
|
||||
justification_stream,
|
||||
subscriptions,
|
||||
subscription_executor,
|
||||
} = grandpa;
|
||||
|
||||
io.extend_with(
|
||||
@@ -172,7 +172,7 @@ pub fn create_full<C, P, SC>(
|
||||
shared_authority_set,
|
||||
shared_voter_state,
|
||||
justification_stream,
|
||||
subscriptions,
|
||||
subscription_executor,
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user