AuthorityRound network simulation test

This commit is contained in:
arkpar
2016-12-06 19:23:15 +01:00
parent fd23a2972c
commit 97f358ced9
15 changed files with 311 additions and 101 deletions

View File

@@ -255,6 +255,11 @@ impl Client {
self.notify.write().push(Arc::downgrade(&target));
}
/// Returns engine reference.
pub fn engine(&self) -> &Engine {
&*self.engine
}
fn notify<F>(&self, f: F) where F: Fn(&ChainNotify) {
for np in self.notify.read().iter() {
if let Some(n) = np.upgrade() {
@@ -563,6 +568,11 @@ impl Client {
results.len()
}
/// Get shared miner reference.
pub fn miner(&self) -> Arc<Miner> {
self.miner.clone()
}
/// Used by PoA to try sealing on period change.
pub fn update_sealing(&self) {
self.miner.update_sealing(self)
@@ -1433,4 +1443,4 @@ mod tests {
assert!(client.tree_route(&genesis, &new_hash).is_none());
}
}
}