babe, aura, pow: only call check_inherents if authoring version is compatible (#6862)

* pow: check can_author_with before calling check_inherents

* babe: check can_author_with before calling check_inherents

* aura: check can_author_with before calling check_inherents

* Fix node and node template compile

* Add missing comma

* Put each parameter on its own line

* Add debug print

* Fix line width too long

* Fix pow line width issue
This commit is contained in:
Wei Tang
2020-08-17 13:41:09 +02:00
committed by GitHub
parent 76290b31c0
commit 3f85b85e80
7 changed files with 97 additions and 24 deletions
@@ -54,7 +54,7 @@ pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponen
grandpa_block_import.clone(), client.clone(),
);
let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _>(
let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>(
sc_consensus_aura::slot_duration(&*client)?,
aura_block_import,
Some(Box::new(grandpa_block_import.clone())),
@@ -63,6 +63,7 @@ pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponen
inherent_data_providers.clone(),
&task_manager.spawn_handle(),
config.prometheus_registry(),
sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()),
)?;
Ok(sc_service::PartialComponents {
@@ -240,7 +241,7 @@ pub fn new_light(config: Configuration) -> Result<TaskManager, ServiceError> {
let finality_proof_request_builder =
finality_proof_import.create_finality_proof_request_builder();
let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _>(
let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>(
sc_consensus_aura::slot_duration(&*client)?,
grandpa_block_import,
None,
@@ -249,6 +250,7 @@ pub fn new_light(config: Configuration) -> Result<TaskManager, ServiceError> {
InherentDataProviders::new(),
&task_manager.spawn_handle(),
config.prometheus_registry(),
sp_consensus::NeverCanAuthor,
)?;
let finality_proof_provider =