mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
Allow many attestation instances to live at once in network (#46)
* multiple consensus sessions in network * tests compile, add a test for RecentSessionKeys * track recently received session keys from validators * add a test for desired key-sending behavior
This commit is contained in:
committed by
Gav Wood
parent
7b46856159
commit
e008813f8b
@@ -36,7 +36,8 @@ use std::collections::{HashMap, HashSet};
|
||||
use std::io;
|
||||
use std::sync::Arc;
|
||||
|
||||
use super::{NetworkService, Knowledge};
|
||||
use consensus::Knowledge;
|
||||
use super::NetworkService;
|
||||
|
||||
fn attestation_topic(parent_hash: Hash) -> Hash {
|
||||
let mut v = parent_hash.as_ref().to_vec();
|
||||
@@ -242,6 +243,13 @@ impl<P: ProvideRuntimeApi + Send> TableRouter for Router<P>
|
||||
}
|
||||
}
|
||||
|
||||
impl<P> Drop for Router<P> {
|
||||
fn drop(&mut self) {
|
||||
let parent_hash = &self.parent_hash;
|
||||
self.network.with_spec(|spec, _| spec.remove_consensus(parent_hash));
|
||||
}
|
||||
}
|
||||
|
||||
/// Receiver for block data.
|
||||
pub struct BlockDataReceiver {
|
||||
inner: ::futures::sync::oneshot::Receiver<BlockData>,
|
||||
|
||||
Reference in New Issue
Block a user