Test syncing to all forks (#1544)

This commit is contained in:
Arkadiy Paronyan
2019-01-24 16:52:48 +01:00
committed by Gav Wood
parent 1b0d90cdf6
commit f38aa0d2de
2 changed files with 22 additions and 0 deletions
+5
View File
@@ -222,6 +222,11 @@ impl<Block: BlockT> Blockchain<Block> {
Ok(())
}
/// Get total number of blocks.
pub fn blocks_count(&self) -> usize {
self.storage.read().blocks.len()
}
/// Compare this blockchain with another in-mem blockchain
pub fn equals_to(&self, other: &Self) -> bool {
self.canon_equals_to(other) && self.storage.read().blocks == other.storage.read().blocks