Cleanup the exports of sc-network (#4983)

* Cleanup the exports of sc-network

* Fix RPC tests

* Revert moving the NetworkStateInfo trait

* Fix GrandPa tests
This commit is contained in:
Pierre Krieger
2020-02-19 16:52:39 +01:00
committed by GitHub
parent 6da156dc53
commit 1489397f7b
15 changed files with 158 additions and 134 deletions
+3 -3
View File
@@ -34,8 +34,8 @@ use futures::{
};
use sc_keystore::{Store as Keystore};
use log::{info, warn, error};
use sc_network::{FinalityProofProvider, OnDemand, NetworkService, NetworkStateInfo};
use sc_network::{config::BoxFinalityProofRequestBuilder, specialization::NetworkSpecialization};
use sc_network::config::{FinalityProofProvider, OnDemand, BoxFinalityProofRequestBuilder};
use sc_network::{NetworkService, NetworkStateInfo, specialization::NetworkSpecialization};
use parking_lot::{Mutex, RwLock};
use sp_runtime::generic::BlockId;
use sp_runtime::traits::{
@@ -369,7 +369,7 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
executor.clone(),
),
);
let fetcher = Arc::new(sc_network::OnDemand::new(fetch_checker));
let fetcher = Arc::new(sc_network::config::OnDemand::new(fetch_checker));
let backend = sc_client::light::new_light_backend(light_blockchain);
let remote_blockchain = backend.remote_blockchain();
let client = Arc::new(sc_client::light::new_light(
+4 -4
View File
@@ -46,7 +46,7 @@ use futures::{
task::{Spawn, FutureObj, SpawnError},
};
use sc_network::{
NetworkService, NetworkState, specialization::NetworkSpecialization,
NetworkService, network_state::NetworkState, specialization::NetworkSpecialization,
PeerId, ReportHandle,
};
use log::{log, warn, debug, error, Level};
@@ -71,7 +71,7 @@ pub use sc_executor::NativeExecutionDispatch;
#[doc(hidden)]
pub use std::{ops::Deref, result::Result, sync::Arc};
#[doc(hidden)]
pub use sc_network::{FinalityProofProvider, OnDemand, config::BoxFinalityProofRequestBuilder};
pub use sc_network::config::{FinalityProofProvider, OnDemand, BoxFinalityProofRequestBuilder};
const DEFAULT_PROTOCOL_ID: &str = "sup";
@@ -634,10 +634,10 @@ where
.collect()
}
impl<B, H, C, Pool, E> sc_network::TransactionPool<H, B> for
impl<B, H, C, Pool, E> sc_network::config::TransactionPool<H, B> for
TransactionPoolAdapter<C, Pool>
where
C: sc_network::ClientHandle<B> + Send + Sync,
C: sc_network::config::Client<B> + Send + Sync,
Pool: 'static + TransactionPool<Block=B, Hash=H, Error=E>,
B: BlockT,
H: std::hash::Hash + Eq + sp_runtime::traits::Member + sp_runtime::traits::MaybeSerialize,