Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

engine error: remove faulty/unused From #11404

Merged
merged 1 commit into from
Jan 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions ethcore/types/src/errors/engine_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@

use std::fmt;

use derive_more::From;
use ethereum_types::{Address, H64, H256};
use unexpected::{Mismatch, OutOfBounds};

/// Voting errors.
#[derive(Debug, From)]
#[derive(Debug)]
pub enum EngineError {
/// Signature or author field does not belong to an authority.
NotAuthorized(Address),
Expand Down Expand Up @@ -78,11 +77,11 @@ impl fmt::Display for EngineError {
use self::EngineError::*;
let msg = match *self {
CliqueMissingCheckpoint(ref hash) => format!("Missing checkpoint block: {}", hash),
CliqueMissingVanity => format!("Extra data is missing vanity data"),
CliqueMissingSignature => format!("Extra data is missing signature"),
CliqueMissingVanity => "Extra data is missing vanity data".into(),
CliqueMissingSignature => "Extra data is missing signature".into(),
CliqueCheckpointInvalidSigners(len) => format!("Checkpoint block list was of length: {} of checkpoint but
it needs to be bigger than zero and a divisible by 20", len),
CliqueCheckpointNoSigner => format!("Checkpoint block list of signers was empty"),
CliqueCheckpointNoSigner => "Checkpoint block list of signers was empty".into(),
CliqueInvalidNonce(ref mis) => format!("Unexpected nonce {} expected {} or {}", mis, 0_u64, u64::max_value()),
CliqueWrongAuthorCheckpoint(ref oob) => format!("Unexpected checkpoint author: {}", oob),
CliqueFaultyRecoveredSigners(ref mis) => format!("Faulty recovered signers {:?}", mis),
Expand All @@ -98,9 +97,9 @@ impl fmt::Display for EngineError {
SystemCallResultDecoding(ref msg) => format!("Failed to decode the result of a system call: {}", msg),
SystemCallResultInvalid(ref msg) => format!("The result of a system call is invalid: {}", msg),
MalformedMessage(ref msg) => format!("Received malformed consensus message: {}", msg),
RequiresClient => format!("Call requires client but none registered"),
RequiresSigner => format!("Call requires signer but none registered"),
InvalidEngine => format!("Invalid engine specification or implementation"),
RequiresClient => "Call requires client but none registered".into(),
RequiresSigner => "Call requires signer but none registered".into(),
InvalidEngine => "Invalid engine specification or implementation".into(),
MissingParent(ref hash) => format!("Parent Epoch is missing from database: {}", hash),
};

Expand Down