From e0f2fac4413822bfa869298b0569f487a79f90f1 Mon Sep 17 00:00:00 2001 From: keorn Date: Fri, 2 Dec 2016 13:32:00 +0000 Subject: [PATCH] new error type --- ethcore/src/engines/authority_round.rs | 1 - ethcore/src/engines/mod.rs | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ethcore/src/engines/authority_round.rs b/ethcore/src/engines/authority_round.rs index 6bce4cf83..f59fd0b17 100644 --- a/ethcore/src/engines/authority_round.rs +++ b/ethcore/src/engines/authority_round.rs @@ -275,7 +275,6 @@ impl Engine for AuthorityRound { } fn verify_block_family(&self, header: &Header, parent: &Header, _block: Option<&[u8]>) -> Result<(), Error> { - // Don't calculate difficulty for genesis blocks. if header.number() == 0 { return Err(From::from(BlockError::RidiculousNumber(OutOfBounds { min: Some(1), max: None, found: header.number() }))); } diff --git a/ethcore/src/engines/mod.rs b/ethcore/src/engines/mod.rs index 67e89b834..f157cc505 100644 --- a/ethcore/src/engines/mod.rs +++ b/ethcore/src/engines/mod.rs @@ -56,6 +56,8 @@ pub enum EngineError { NotProposer(Mismatch), /// Message was not expected. UnexpectedMessage, + /// Seal field has an unexpected size. + BadSealFieldSize(OutOfBounds), } impl fmt::Display for EngineError { @@ -66,6 +68,7 @@ impl fmt::Display for EngineError { NotProposer(ref mis) => format!("Author is not a current proposer: {}", mis), NotAuthorized(ref address) => format!("Signer {} is not authorized.", address), UnexpectedMessage => "This Engine should not be fed messages.".into(), + BadSealFieldSize(ref oob) => format!("Seal field has an unexpected length: {}", oob), }; f.write_fmt(format_args!("Engine error ({})", msg))