Check in block authoring that we can author with current authoring version (#4201)

* Check in block authoring that we can author with current authoring version

* Update client/consensus/pow/src/lib.rs

Co-Authored-By: André Silva <andre.beat@gmail.com>

* Fix compilation
This commit is contained in:
Bastian Köcher
2019-11-29 11:01:11 +01:00
committed by GitHub
parent 0b52f194f5
commit accc678640
18 changed files with 187 additions and 62 deletions
+3 -10
View File
@@ -28,7 +28,6 @@ use parity_scale_codec::Error as CodecError;
/// Client Result type alias
pub type Result<T> = result::Result<T, Error>;
/// Error when the runtime failed to apply an extrinsic.
#[derive(Debug, Display)]
pub enum ApplyExtrinsicFailed {
@@ -72,8 +71,9 @@ pub enum Error {
#[display(fmt = "Current state of blockchain has invalid authorities set")]
InvalidAuthoritiesSet,
/// Could not get runtime version.
#[display(fmt = "On-chain runtime does not specify version")]
VersionInvalid,
#[display(fmt = "Failed to get runtime version: {}", _0)]
#[from(ignore)]
VersionInvalid(String),
/// Genesis config is invalid.
#[display(fmt = "Genesis config provided is invalid")]
GenesisInvalid,
@@ -125,7 +125,6 @@ pub enum Error {
InvalidStateRoot,
/// A convenience variant for String
#[display(fmt = "{}", _0)]
#[from(ignore)]
Msg(String),
}
@@ -139,12 +138,6 @@ impl error::Error for Error {
}
}
impl From<String> for Error {
fn from(s: String) -> Self {
Error::Msg(s)
}
}
impl<'a> From<&'a str> for Error {
fn from(s: &'a str) -> Self {
Error::Msg(s.into())