dedicated types

This commit is contained in:
NikVolf
2016-07-01 21:33:59 +03:00
parent 0907722fc8
commit 07521c17b4
5 changed files with 111 additions and 2 deletions

View File

@@ -250,7 +250,7 @@ impl fmt::Display for Error {
}
/// Result of import block operation.
pub type ImportResult = Result<H256, Error>;
pub type ImportResult = Result<H256, BlockImportError>;
impl From<ClientError> for Error {
fn from(err: ClientError) -> Error {
@@ -312,6 +312,21 @@ impl From<TrieError> for Error {
}
}
impl From<BlockImportError> for Error {
fn from(err: BlockImportError) -> Error {
match err {
BlockImportError::Block(e) => Error::Block(e),
BlockImportError::Import(e) => Error::Import(e),
BlockImportError::Other(s) => Error::Util(UtilError::SimpleString(s)),
}
}
}
binary_fixed_size!(BlockError);
binary_fixed_size!(ImportError);
binary_fixed_size!(TransactionError);
// TODO: uncomment below once https://github.com/rust-lang/rust/issues/27336 sorted.
/*#![feature(concat_idents)]
macro_rules! assimilate {