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
@@ -247,6 +247,15 @@ impl<Block: BlockT> CanAuthorWith<Block> for AlwaysCanAuthor {
}
}
/// Never can author.
pub struct NeverCanAuthor;
impl<Block: BlockT> CanAuthorWith<Block> for NeverCanAuthor {
fn can_author_with(&self, _: &BlockId<Block>) -> Result<(), String> {
Err("Authoring is always disabled.".to_string())
}
}
/// A type from which a slot duration can be obtained.
pub trait SlotData {
/// Gets the slot duration.