mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Small slots refactor (#2780)
* Deprecate SlotWorker::on_start * start_slot_worker no longer needs an Arc * start_slot_worker now always succeeds * Removed on_exit parameter from start_*_worker * Minor doc * Fix node-template
This commit is contained in:
committed by
DemiMarie-parity
parent
eaa0ab014a
commit
67bdfc7d8e
@@ -14,6 +14,7 @@ use substrate_service::{
|
||||
};
|
||||
use basic_authorship::ProposerFactory;
|
||||
use consensus::{import_queue, start_aura, AuraImportQueue, SlotDuration, NothingExtra};
|
||||
use futures::prelude::*;
|
||||
use substrate_client::{self as client, LongestChain};
|
||||
use primitives::{ed25519::Pair, Pair as PairT};
|
||||
use inherents::InherentDataProviders;
|
||||
@@ -75,7 +76,7 @@ construct_service_factory! {
|
||||
let client = service.client();
|
||||
let select_chain = service.select_chain()
|
||||
.ok_or_else(|| ServiceError::SelectChainRequired)?;
|
||||
executor.spawn(start_aura(
|
||||
let aura = start_aura(
|
||||
SlotDuration::get_or_compute(&*client)?,
|
||||
key.clone(),
|
||||
client.clone(),
|
||||
@@ -83,10 +84,10 @@ construct_service_factory! {
|
||||
client,
|
||||
proposer,
|
||||
service.network(),
|
||||
service.on_exit(),
|
||||
service.config.custom.inherent_data_providers.clone(),
|
||||
service.config.force_authoring,
|
||||
)?);
|
||||
)?;
|
||||
executor.spawn(aura.select(service.on_exit()).then(|_| Ok(())));
|
||||
}
|
||||
|
||||
Ok(service)
|
||||
|
||||
Reference in New Issue
Block a user