File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ pub use client::FetchClient;
66
77use crate :: { message:: BlockRequest , session:: BlockRangeInfo , transform:: header:: HeaderTransform } ;
88use alloy_primitives:: B256 ;
9- use futures:: { future :: join_all , StreamExt } ;
9+ use futures:: StreamExt ;
1010use reth_eth_wire:: { EthNetworkPrimitives , GetBlockBodies , GetBlockHeaders , NetworkPrimitives } ;
1111use reth_network_api:: test_utils:: PeersHandle ;
1212use reth_network_p2p:: {
@@ -282,9 +282,7 @@ impl<N: NetworkPrimitives> StateFetcher<N> {
282282 let header_transform = self . header_transform . clone ( ) ;
283283 tokio:: spawn ( async move {
284284 let res = match res {
285- Ok ( headers) => {
286- Ok ( join_all ( headers. into_iter ( ) . map ( |h| header_transform. map ( h) ) ) . await )
287- }
285+ Ok ( headers) => Ok ( header_transform. map ( headers) . await ) ,
288286 Err ( e) => Err ( e) ,
289287 } ;
290288
Original file line number Diff line number Diff line change 22
33use reth_primitives_traits:: BlockHeader ;
44
5- /// An instance of the trait applies a mapping to the input header .
5+ /// An instance of the trait applies a mapping to the input headers .
66#[ async_trait:: async_trait]
77pub trait HeaderTransform < H : BlockHeader > : std:: fmt:: Debug + Send + Sync {
8- /// Applies a mapping to the input header .
9- async fn map ( & self , header : H ) -> H ;
8+ /// Applies a mapping to the input headers .
9+ async fn map ( & self , headers : Vec < H > ) -> Vec < H > ;
1010}
1111
1212#[ async_trait:: async_trait]
1313impl < H : BlockHeader > HeaderTransform < H > for ( ) {
14- async fn map ( & self , header : H ) -> H {
15- header
14+ async fn map ( & self , headers : Vec < H > ) -> Vec < H > {
15+ headers
1616 }
1717}
1818
You can’t perform that action at this time.
0 commit comments