UtilError uses error_chain!, moved OutOfBounds and Mismatched to unexpected crate

This commit is contained in:
debris
2017-09-05 12:14:03 +02:00
parent ccd6ad52cc
commit 236b6f1c3e
25 changed files with 137 additions and 131 deletions

View File

@@ -20,6 +20,7 @@ use std::fmt;
use bigint::prelude::U256;
use bigint::hash::H256;
use util::*;
use unexpected::{Mismatch, OutOfBounds};
use io::*;
use header::BlockNumber;
use basic_types::LogBloom;
@@ -391,7 +392,7 @@ impl From<ExecutionError> for Error {
impl From<::rlp::DecoderError> for Error {
fn from(err: ::rlp::DecoderError) -> Error {
Error::Util(UtilError::Decoder(err))
Error::Util(UtilError::from(err))
}
}
@@ -424,7 +425,7 @@ impl From<BlockImportError> for Error {
match err {
BlockImportError::Block(e) => Error::Block(e),
BlockImportError::Import(e) => Error::Import(e),
BlockImportError::Other(s) => Error::Util(UtilError::SimpleString(s)),
BlockImportError::Other(s) => Error::Util(UtilError::from(s)),
}
}
}