Properly handle check_epoch_end_signal errors (#10015)

* Make check_epoch_end_signal to only use immutable data

* Move check_epoch_end_signals out of commit_block

* Make check_epoch_end_signals possible to fail

* Actually return the error from check_epoch_end_signals

* Remove a clone

* Fix import error
This commit is contained in:
Wei Tang
2019-02-07 14:34:07 +01:00
committed by Afri Schoedon
parent e45ee6cd72
commit 8fa56add47
3 changed files with 49 additions and 28 deletions

View File

@@ -1284,6 +1284,13 @@ impl<B: Backend> fmt::Debug for State<B> {
}
}
impl State<StateDB> {
/// Get a reference to the underlying state DB.
pub fn db(&self) -> &StateDB {
&self.db
}
}
// TODO: cloning for `State` shouldn't be possible in general; Remove this and use
// checkpoints where possible.
impl Clone for State<StateDB> {