From d16ad68339f83eb614efff8853b673276c6db1a8 Mon Sep 17 00:00:00 2001 From: Shamil Gadelshin Date: Tue, 30 Apr 2024 18:00:31 +0700 Subject: [PATCH] Make entities public to support fast-sync. --- substrate/client/network/sync/src/lib.rs | 4 ++-- substrate/client/network/sync/src/pending_responses.rs | 4 ++-- substrate/client/network/sync/src/schema.rs | 2 +- substrate/client/network/sync/src/strategy.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/substrate/client/network/sync/src/lib.rs b/substrate/client/network/sync/src/lib.rs index 9f6c0f45d089..68bb5dabcac6 100644 --- a/substrate/client/network/sync/src/lib.rs +++ b/substrate/client/network/sync/src/lib.rs @@ -25,9 +25,9 @@ pub use types::{SyncEvent, SyncEventStream, SyncState, SyncStatus, SyncStatusPro mod block_announce_validator; mod futures_stream; mod justification_requests; -mod pending_responses; +pub mod pending_responses; mod request_metrics; -mod schema; +pub mod schema; pub mod types; pub mod block_relay_protocol; diff --git a/substrate/client/network/sync/src/pending_responses.rs b/substrate/client/network/sync/src/pending_responses.rs index 602c69df7ff9..3d51328092ac 100644 --- a/substrate/client/network/sync/src/pending_responses.rs +++ b/substrate/client/network/sync/src/pending_responses.rs @@ -40,7 +40,7 @@ type ResponseResult = Result, ProtocolName), RequestFailure>, on type ResponseFuture = BoxFuture<'static, ResponseResult>; /// An event we receive once a pending response future resolves. -pub(crate) struct ResponseEvent { +pub struct ResponseEvent { pub peer_id: PeerId, pub key: StrategyKey, pub request: PeerRequest, @@ -48,7 +48,7 @@ pub(crate) struct ResponseEvent { } /// Stream taking care of polling pending responses. -pub(crate) struct PendingResponses { +pub struct PendingResponses { /// Pending responses pending_responses: StreamMap<(PeerId, StrategyKey), BoxStream<'static, (PeerRequest, ResponseResult)>>, diff --git a/substrate/client/network/sync/src/schema.rs b/substrate/client/network/sync/src/schema.rs index 22b7ee592778..f995e5c991a1 100644 --- a/substrate/client/network/sync/src/schema.rs +++ b/substrate/client/network/sync/src/schema.rs @@ -18,6 +18,6 @@ //! Include sources generated from protobuf definitions. -pub(crate) mod v1 { +pub mod v1 { include!(concat!(env!("OUT_DIR"), "/api.v1.rs")); } diff --git a/substrate/client/network/sync/src/strategy.rs b/substrate/client/network/sync/src/strategy.rs index fc3c0039dffd..1397fba74803 100644 --- a/substrate/client/network/sync/src/strategy.rs +++ b/substrate/client/network/sync/src/strategy.rs @@ -20,7 +20,7 @@ //! and specific syncing algorithms. pub mod chain_sync; -pub(crate) mod state; +pub mod state; pub mod state_sync; pub mod warp;