companion for substrate#13883 (#7059)

* companion for substrate#13883

* update lockfile for {"substrate"}

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
André Silva
2023-04-18 11:25:03 +01:00
committed by GitHub
parent 58c18348c5
commit 8d1603e38d
3 changed files with 196 additions and 210 deletions
+188 -188
View File
File diff suppressed because it is too large Load Diff
+2 -6
View File
@@ -531,7 +531,7 @@ where
babe::block_import(babe_config.clone(), beefy_block_import, client.clone())?;
let slot_duration = babe_link.config().slot_duration();
let import_queue = babe::import_queue(
let (import_queue, babe_worker_handle) = babe::import_queue(
babe_link.clone(),
block_import.clone(),
Some(Box::new(justification_import)),
@@ -561,9 +561,6 @@ where
Some(shared_authority_set.clone()),
);
let shared_epoch_changes = babe_link.epoch_changes().clone();
let slot_duration = babe_config.slot_duration();
let import_setup = (block_import, grandpa_link, babe_link, beefy_voter_links);
let rpc_setup = shared_voter_state.clone();
@@ -585,8 +582,7 @@ where
chain_spec: chain_spec.cloned_box(),
deny_unsafe,
babe: polkadot_rpc::BabeDeps {
babe_config: babe_config.clone(),
shared_epoch_changes: shared_epoch_changes.clone(),
babe_worker_handle: babe_worker_handle.clone(),
keystore: keystore.clone(),
},
grandpa: polkadot_rpc::GrandpaDeps {
+6 -16
View File
@@ -23,7 +23,6 @@ use std::sync::Arc;
use jsonrpsee::RpcModule;
use polkadot_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Nonce};
use sc_client_api::AuxStore;
use sc_consensus_babe::{BabeConfiguration, Epoch};
use sc_consensus_beefy::communication::notification::{
BeefyBestBlockStream, BeefyVersionedFinalityProofStream,
};
@@ -42,10 +41,8 @@ pub type RpcExtension = RpcModule<()>;
/// Extra dependencies for BABE.
pub struct BabeDeps {
/// BABE protocol config.
pub babe_config: BabeConfiguration,
/// BABE pending epoch changes.
pub shared_epoch_changes: sc_consensus_epochs::SharedEpochChanges<Block, Epoch>,
/// A handle to the BABE worker for issuing requests.
pub babe_worker_handle: sc_consensus_babe::BabeWorkerHandle<Block>,
/// The keystore that manages the keys of the node.
pub keystore: KeystorePtr,
}
@@ -129,7 +126,7 @@ where
let mut io = RpcModule::new(());
let FullDeps { client, pool, select_chain, chain_spec, deny_unsafe, babe, grandpa, beefy } =
deps;
let BabeDeps { keystore, babe_config, shared_epoch_changes } = babe;
let BabeDeps { babe_worker_handle, keystore } = babe;
let GrandpaDeps {
shared_voter_state,
shared_authority_set,
@@ -143,15 +140,8 @@ where
io.merge(TransactionPayment::new(client.clone()).into_rpc())?;
io.merge(Mmr::new(client.clone()).into_rpc())?;
io.merge(
Babe::new(
client.clone(),
shared_epoch_changes.clone(),
keystore,
babe_config,
select_chain,
deny_unsafe,
)
.into_rpc(),
Babe::new(client.clone(), babe_worker_handle.clone(), keystore, select_chain, deny_unsafe)
.into_rpc(),
)?;
io.merge(
Grandpa::new(
@@ -164,7 +154,7 @@ where
.into_rpc(),
)?;
io.merge(
SyncState::new(chain_spec, client, shared_authority_set, shared_epoch_changes)?.into_rpc(),
SyncState::new(chain_spec, client, shared_authority_set, babe_worker_handle)?.into_rpc(),
)?;
io.merge(