mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 13:21:01 +00:00
Single ParachainBlockImport instance (#1782)
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
use std::{marker::PhantomData, sync::Arc};
|
||||
|
||||
use cumulus_client_consensus_common::ParachainBlockImport;
|
||||
|
||||
use sc_consensus::{
|
||||
import_queue::{BasicQueue, Verifier as VerifierT},
|
||||
BlockImport, BlockImportParams,
|
||||
@@ -103,7 +105,7 @@ where
|
||||
/// Start an import queue for a Cumulus collator that does not uses any special authoring logic.
|
||||
pub fn import_queue<Client, Block: BlockT, I, CIDP>(
|
||||
client: Arc<Client>,
|
||||
block_import: I,
|
||||
block_import: ParachainBlockImport<I>,
|
||||
create_inherent_data_providers: CIDP,
|
||||
spawner: &impl sp_core::traits::SpawnEssentialNamed,
|
||||
registry: Option<&substrate_prometheus_endpoint::Registry>,
|
||||
@@ -117,11 +119,5 @@ where
|
||||
{
|
||||
let verifier = Verifier::new(client, create_inherent_data_providers);
|
||||
|
||||
Ok(BasicQueue::new(
|
||||
verifier,
|
||||
Box::new(cumulus_client_consensus_common::ParachainBlockImport::new(block_import)),
|
||||
None,
|
||||
spawner,
|
||||
registry,
|
||||
))
|
||||
Ok(BasicQueue::new(verifier, Box::new(block_import), None, spawner, registry))
|
||||
}
|
||||
|
||||
@@ -90,16 +90,14 @@ where
|
||||
para_id: ParaId,
|
||||
proposer_factory: PF,
|
||||
create_inherent_data_providers: CIDP,
|
||||
block_import: BI,
|
||||
block_import: ParachainBlockImport<BI>,
|
||||
relay_chain_interface: RCInterface,
|
||||
) -> Self {
|
||||
Self {
|
||||
para_id,
|
||||
proposer_factory: Arc::new(Mutex::new(proposer_factory)),
|
||||
create_inherent_data_providers: Arc::new(create_inherent_data_providers),
|
||||
block_import: Arc::new(futures::lock::Mutex::new(ParachainBlockImport::new(
|
||||
block_import,
|
||||
))),
|
||||
block_import: Arc::new(futures::lock::Mutex::new(block_import)),
|
||||
relay_chain_interface,
|
||||
_phantom: PhantomData,
|
||||
}
|
||||
@@ -222,7 +220,7 @@ pub struct BuildRelayChainConsensusParams<PF, BI, CIDP, RCInterface> {
|
||||
pub para_id: ParaId,
|
||||
pub proposer_factory: PF,
|
||||
pub create_inherent_data_providers: CIDP,
|
||||
pub block_import: BI,
|
||||
pub block_import: ParachainBlockImport<BI>,
|
||||
pub relay_chain_interface: RCInterface,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user