Move DummySpecialization to sc-network (#4680)

This commit is contained in:
Pierre Krieger
2020-01-20 12:57:49 +01:00
committed by Gavin Wood
parent 96cd57a695
commit 4e0ac574e2
2 changed files with 27 additions and 26 deletions
+1 -26
View File
@@ -62,6 +62,7 @@ use substrate_test_runtime_client::{self, AccountKeyring};
pub use substrate_test_runtime_client::runtime::{Block, Extrinsic, Hash, Transfer};
pub use substrate_test_runtime_client::{TestClient, TestClientBuilder, TestClientBuilderExt};
pub use sc_network::specialization::DummySpecialization;
type AuthorityId = sp_consensus_babe::AuthorityId;
@@ -101,32 +102,6 @@ impl<B: BlockT> Verifier<B> for PassThroughVerifier {
}
}
/// The test specialization.
#[derive(Clone)]
pub struct DummySpecialization;
impl NetworkSpecialization<Block> for DummySpecialization {
fn status(&self) -> Vec<u8> {
vec![]
}
fn on_connect(
&mut self,
_ctx: &mut dyn Context<Block>,
_peer_id: PeerId,
_status: sc_network::message::Status<Block>
) {}
fn on_disconnect(&mut self, _ctx: &mut dyn Context<Block>, _peer_id: PeerId) {}
fn on_message(
&mut self,
_ctx: &mut dyn Context<Block>,
_peer_id: PeerId,
_message: Vec<u8>,
) {}
}
pub type PeersFullClient =
sc_client::Client<substrate_test_runtime_client::Backend, substrate_test_runtime_client::Executor, Block, substrate_test_runtime_client::runtime::RuntimeApi>;
pub type PeersLightClient =