Remove blocking sync -> import-queue operations (#1818)

* remove blocking sync -> import-queue operations

add specialization to testnet

remove add peer default impl on TestNetFactory

* remove empty brackets from dummy specialization

* nits

* make mut_peers take an fn once

* add SpecializationFactory trait in test

* remove add_peer imple in grandpa, fix typo

* use cmp::max for best importing number comparison

* remove import of non-existent create_peer

* add sender to start message
This commit is contained in:
Gregory Terzian authored and Bastian Köcher committed 2019-02-28 12:11:18 +01:00
1 parent 04fed82940
commit 8a72abffdd
7 files changed
+190 -187

No files matched your search

+5 -4
View File
@@ -699,11 +699,12 @@ mod tests {
const TEST_ROUTING_INTERVAL: Duration = Duration::from_millis(50);
pub struct AuraTestNet {
peers: Vec<Arc<Peer<()>>>,
peers: Vec<Arc<Peer<(), DummySpecialization>>>,
started: bool,
}
impl TestNetFactory for AuraTestNet {
type Specialization = DummySpecialization;
type Verifier = AuraVerifier<PeersClient, NothingExtra>;
type PeerData = ();
@@ -734,15 +735,15 @@ mod tests {
})
}
fn peer(&self, i: usize) -> &Peer<Self::PeerData> {
fn peer(&self, i: usize) -> &Peer<Self::PeerData, DummySpecialization> {
&self.peers[i]
}
fn peers(&self) -> &Vec<Arc<Peer<Self::PeerData>>> {
fn peers(&self) -> &Vec<Arc<Peer<Self::PeerData, DummySpecialization>>> {
&self.peers
}
fn mut_peers<F: Fn(&mut Vec<Arc<Peer<Self::PeerData>>>)>(&mut self, closure: F) {
fn mut_peers<F: FnOnce(&mut Vec<Arc<Peer<Self::PeerData, DummySpecialization>>>)>(&mut self, closure: F) {
closure(&mut self.peers);
}