improve error types

This commit is contained in:
keorn 2016-11-24 13:55:16 +00:00
parent d5b15d4560
commit 207364929c
1 changed files with 4 additions and 4 deletions

View File

@ -171,9 +171,9 @@ pub enum BlockError {
/// The same author issued different votes at the same step.
DoubleVote(H160),
/// The received block is from an incorrect proposer.
NotProposer(H160),
NotProposer(Mismatch<H160>),
/// Signature does not belong to an authority.
NotAuthority(H160)
NotAuthorized(H160)
}
impl fmt::Display for BlockError {
@ -208,8 +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),
NotProposer(ref mis) => format!("Author is not a current proposer: {}", mis),
NotAuthorized(ref address) => format!("Signer {} is not authorized.", address),
};
f.write_fmt(format_args!("Block error ({})", msg))