Remove NetworkSpecialization (#4665)

* remove networkspecialization

* Fix most of the fallout

* get all tests compiling

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
Robert Habermeier
2020-02-21 05:02:12 -08:00
committed by GitHub
parent e8000e7429
commit 0090fe979b
20 changed files with 136 additions and 503 deletions
+2 -9
View File
@@ -30,7 +30,6 @@ use sc_service::{
AbstractService, ServiceBuilder, config::Configuration, error::{Error as ServiceError},
};
use sp_inherents::InherentDataProviders;
use sc_network::construct_simple_protocol;
use sc_service::{Service, NetworkStatus};
use sc_client::{Client, LocalCallExecutor};
@@ -40,11 +39,6 @@ use node_executor::NativeExecutor;
use sc_network::NetworkService;
use sc_offchain::OffchainWorkers;
construct_simple_protocol! {
/// Demo protocol attachment for substrate.
pub struct NodeProtocol where Block = Block { }
}
/// Starts a `ServiceBuilder` for a full service.
///
/// Use this macro if you don't actually need the full service, but just the builder in order to
@@ -144,7 +138,7 @@ macro_rules! new_full {
let (builder, mut import_setup, inherent_data_providers) = new_full_start!($config);
let service = builder.with_network_protocol(|_| Ok(crate::service::NodeProtocol::new()))?
let service = builder
.with_finality_proof_provider(|client, backend|
Ok(Arc::new(grandpa::FinalityProofProvider::new(backend, client)) as _)
)?
@@ -283,7 +277,7 @@ pub fn new_full(config: NodeConfiguration)
ConcreteClient,
LongestChain<ConcreteBackend, ConcreteBlock>,
NetworkStatus<ConcreteBlock>,
NetworkService<ConcreteBlock, crate::service::NodeProtocol, <ConcreteBlock as BlockT>::Hash>,
NetworkService<ConcreteBlock, <ConcreteBlock as BlockT>::Hash>,
ConcreteTransactionPool,
OffchainWorkers<
ConcreteClient,
@@ -348,7 +342,6 @@ pub fn new_light(config: NodeConfiguration)
Ok((import_queue, finality_proof_request_builder))
})?
.with_network_protocol(|_| Ok(NodeProtocol::new()))?
.with_finality_proof_provider(|client, backend|
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, client)) as _)
)?