ValidationNetwork expose more functionality (#301)

* Expose `collator_id_to_peer_id`

* `ValidationNetwork` expose `checked_statements`

* Style nit
This commit is contained in:
Bastian Köcher
2019-06-25 21:28:54 +02:00
committed by GitHub
parent 7a5b9bddf5
commit 6eb3f92a8e
4 changed files with 63 additions and 21 deletions
+5
View File
@@ -216,6 +216,11 @@ impl CollatorPool {
let now = Instant::now();
self.collations.retain(|&(ref h, _), slot| chain_head != Some(h) && slot.stay_alive(now));
}
/// Convert the given `CollatorId` to a `PeerId`.
pub fn collator_id_to_peer_id(&self, collator_id: &CollatorId) -> Option<&PeerId> {
self.collators.get(collator_id).map(|ids| &ids.1)
}
}
#[cfg(test)]