File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ pub use capability::*;
4747pub mod primitives;
4848pub use primitives:: * ;
4949
50- mod snap;
50+ pub mod snap;
5151pub use snap:: * ;
5252
5353/// re-export for convenience
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ pub mod priority;
4141/// Syncing related traits.
4242pub mod sync;
4343
44+ /// Snap related traits.
45+ pub mod snap;
46+
4447/// Common test helpers for mocking out Consensus, Downloaders and Header Clients.
4548#[ cfg( any( test, feature = "test-utils" ) ) ]
4649pub mod test_utils;
Original file line number Diff line number Diff line change 1+ use crate :: { download:: DownloadClient , error:: PeerRequestResult , priority:: Priority } ;
2+ use futures:: Future ;
3+ use reth_eth_wire_types:: snap:: { AccountRangeMessage , GetAccountRangeMessage } ;
4+
5+ /// The snap sync downloader client
6+ #[ auto_impl:: auto_impl( & , Arc , Box ) ]
7+ pub trait SnapClient : DownloadClient {
8+ /// The output future type for account range requests
9+ type Output : Future < Output = PeerRequestResult < AccountRangeMessage > > + Send + Sync + Unpin ;
10+
11+ /// Sends the account range request to the p2p network and returns the account range
12+ /// response received from a peer.
13+ fn get_account_range ( & self , request : GetAccountRangeMessage ) -> Self :: Output {
14+ self . get_account_range_with_priority ( request, Priority :: Normal )
15+ }
16+
17+ /// Sends the account range request to the p2p network with priority set and returns
18+ /// the account range response received from a peer.
19+ fn get_account_range_with_priority (
20+ & self ,
21+ request : GetAccountRangeMessage ,
22+ priority : Priority ,
23+ ) -> Self :: Output ;
24+ }
Original file line number Diff line number Diff line change 1+ /// SNAP related traits.
2+ pub mod client;
You can’t perform that action at this time.
0 commit comments