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
+3 -2
View File
@@ -31,7 +31,7 @@ use sp_consensus_babe::{
};
use sc_block_builder::{BlockBuilder, BlockBuilderProvider};
use sp_consensus::{
NoNetwork as DummyOracle, Proposal, RecordProof,
NoNetwork as DummyOracle, Proposal, RecordProof, AlwaysCanAuthor,
import_queue::{BoxBlockImport, BoxJustificationImport, BoxFinalityProofImport},
};
use sc_network_test::*;
@@ -220,7 +220,7 @@ type TestSelectChain = substrate_test_runtime_client::LongestChain<
>;
pub struct TestVerifier {
inner: BabeVerifier<TestBlock, PeersFullClient, TestSelectChain>,
inner: BabeVerifier<TestBlock, PeersFullClient, TestSelectChain, AlwaysCanAuthor>,
mutator: Mutator,
}
@@ -320,6 +320,7 @@ impl TestNetFactory for BabeTestNet {
config: data.link.config.clone(),
epoch_changes: data.link.epoch_changes.clone(),
time_source: data.link.time_source.clone(),
can_author_with: AlwaysCanAuthor,
},
mutator: MUTATOR.with(|m| m.borrow().clone()),
}