From 8f6a464c5181abc14c60d13dbcdaffca80b2d4b0 Mon Sep 17 00:00:00 2001 From: keorn Date: Tue, 22 Nov 2016 17:15:22 +0000 Subject: [PATCH] new error types --- ethcore/src/error.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ethcore/src/error.rs b/ethcore/src/error.rs index 9206447eb..5ba4aa0c2 100644 --- a/ethcore/src/error.rs +++ b/ethcore/src/error.rs @@ -170,6 +170,10 @@ pub enum BlockError { UnknownUncleParent(H256), /// The same author issued different votes at the same step. DoubleVote(H160), + /// The received block is from an incorrect proposer. + NotProposer(H160), + /// Signature does not belong to an authority. + NotAuthority(H160) } impl fmt::Display for BlockError { @@ -204,6 +208,8 @@ impl fmt::Display for BlockError { UnknownParent(ref hash) => format!("Unknown parent: {}", hash), UnknownUncleParent(ref hash) => format!("Unknown uncle parent: {}", hash), DoubleVote(ref address) => format!("Author {} issued too many blocks.", address), + NotProposer(ref address) => format!("Author {} is not a current proposer.", address), + NotAuthority(ref address) => format!("Signer {} is not authorized.", address), }; f.write_fmt(format_args!("Block error ({})", msg))