Network sync refactoring (part 1) (#11303)

* Remove unnecessary imports, move one internal re-export into where it is actually used, make one import explicit

* Move a few data structures down into modules

* Use generic parameters in `sc-network` instead of `chain::Client` trait

* Remove unnecessary bound
This commit is contained in:
Nazar Mokrynskyi
2022-04-29 17:02:03 +03:00
committed by GitHub
parent 887acda7d0
commit af6773aba9
15 changed files with 380 additions and 206 deletions
+6 -3
View File
@@ -22,7 +22,6 @@
//! See the documentation of [`Params`].
pub use crate::{
chain::Client,
request_responses::{
IncomingRequest, OutgoingResponse, ProtocolConfig as RequestResponseConfig,
},
@@ -64,7 +63,11 @@ use std::{
use zeroize::Zeroize;
/// Network initialization parameters.
pub struct Params<B: BlockT, H: ExHashT> {
pub struct Params<B, H, Client>
where
B: BlockT + 'static,
H: ExHashT,
{
/// Assigned role for our node (full, light, ...).
pub role: Role,
@@ -79,7 +82,7 @@ pub struct Params<B: BlockT, H: ExHashT> {
pub network_config: NetworkConfiguration,
/// Client that contains the blockchain.
pub chain: Arc<dyn Client<B>>,
pub chain: Arc<Client>,
/// Pool of transactions.
///