mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 21:11:07 +00:00
Generalize the Consensus Infrastructure (#883)
* Split out Consensus * Supply ImportQueue through network-service - simplify ImportQueue.import_blocks - remove Deadlock on import_block - Adding Verifier-Trait - Implement import_queue provisioning in service; allow cli to import * Allow to actually customize import queue * Consensus Gossip: Cache Message hash per Topic
This commit is contained in:
committed by
GitHub
parent
a24e61cb29
commit
ac4bcf879f
@@ -47,7 +47,7 @@ use service::{
|
||||
FactoryExtrinsic,
|
||||
};
|
||||
use network::{NetworkConfiguration, NonReservedPeerMode, Protocol, SyncProvider, ManageNetwork};
|
||||
use client::{BlockOrigin, JustifiedHeader};
|
||||
use client::ImportBlock;
|
||||
use sr_primitives::traits::As;
|
||||
use sr_primitives::generic::BlockId;
|
||||
|
||||
@@ -216,7 +216,7 @@ pub fn connectivity<F: ServiceFactory>(spec: FactoryChainSpec<F>) {
|
||||
pub fn sync<F, B, E>(spec: FactoryChainSpec<F>, block_factory: B, extrinsic_factory: E)
|
||||
where
|
||||
F: ServiceFactory,
|
||||
B: Fn(&F::FullService) -> (JustifiedHeader<F::Block>, Option<Vec<FactoryExtrinsic<F>>>),
|
||||
B: Fn(&F::FullService) -> ImportBlock<F::Block>,
|
||||
E: Fn(&F::FullService) -> FactoryExtrinsic<F>,
|
||||
{
|
||||
const NUM_NODES: u32 = 10;
|
||||
@@ -230,8 +230,8 @@ where
|
||||
if i % 128 == 0 {
|
||||
info!("Generating #{}", i);
|
||||
}
|
||||
let (header, body) = block_factory(&first_service);
|
||||
first_service.client().import_block(BlockOrigin::File, header, body, true).expect("Error importing test block");
|
||||
let import_data = block_factory(&first_service);
|
||||
first_service.client().import_block(import_data, None).expect("Error importing test block");
|
||||
}
|
||||
first_service.network().node_id().unwrap()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user