add a state rebuilder

This commit is contained in:
Robert Habermeier
2016-06-15 17:46:40 +02:00
parent d7498c1dd5
commit 0e3a15cadb
4 changed files with 92 additions and 18 deletions

View File

@@ -228,6 +228,8 @@ pub enum Error {
Trie(TrieError),
/// Io error.
Io(::std::io::Error),
/// Snappy error.
Snappy(::util::snappy::Error),
}
impl fmt::Display for Error {
@@ -245,6 +247,7 @@ impl fmt::Display for Error {
Error::PowInvalid => f.write_str("Invalid nonce or mishash"),
Error::Trie(ref err) => f.write_fmt(format_args!("{}", err)),
Error::Io(ref err) => f.write_fmt(format_args!("{}", err)),
Error::Snappy(ref err) => f.write_fmt(format_args!("{}", err)),
}
}
}
@@ -318,6 +321,12 @@ impl From<::std::io::Error> for Error {
}
}
impl From<::util::snappy::Error> for Error {
fn from(err: ::util::snappy::Error) -> Error {
Error::Snappy(err)
}
}
// TODO: uncomment below once https://github.com/rust-lang/rust/issues/27336 sorted.
/*#![feature(concat_idents)]
macro_rules! assimilate {