dedicated types
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user