chore(deps): clean up unused imports and dependencies in reth-downloaders (#19875)

This commit is contained in:
Fallengirl
2025-12-06 17:27:27 +01:00
committed by GitHub
parent 4bde1bb048
commit d765521c3d
3 changed files with 11 additions and 4 deletions

View File

@@ -67,6 +67,8 @@ assert_matches.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
rand.workspace = true
tempfile.workspace = true
alloy-rlp.workspace = true
itertools.workspace = true
[features]
default = []

View File

@@ -13,6 +13,9 @@
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#[cfg(any(test, feature = "test-utils"))]
use tempfile as _;
/// The collection of algorithms for downloading block bodies.
pub mod bodies;

View File

@@ -5,12 +5,9 @@
#[cfg(any(test, feature = "file-client"))]
use crate::{bodies::test_utils::create_raw_bodies, file_codec::BlockFileCodec};
use alloy_primitives::B256;
use futures::SinkExt;
use reth_ethereum_primitives::BlockBody;
use reth_testing_utils::generators::{self, random_block_range, BlockRangeParams};
use std::{collections::HashMap, io::SeekFrom, ops::RangeInclusive};
use tokio::{fs::File, io::AsyncSeekExt};
use tokio_util::codec::FramedWrite;
use std::{collections::HashMap, ops::RangeInclusive};
mod bodies_client;
pub use bodies_client::TestBodiesClient;
@@ -42,6 +39,11 @@ pub(crate) fn generate_bodies(
pub(crate) async fn generate_bodies_file(
range: RangeInclusive<u64>,
) -> (tokio::fs::File, Vec<SealedHeader>, HashMap<B256, BlockBody>) {
use futures::SinkExt;
use std::io::SeekFrom;
use tokio::{fs::File, io::AsyncSeekExt};
use tokio_util::codec::FramedWrite;
let (headers, bodies) = generate_bodies(range);
let raw_block_bodies = create_raw_bodies(headers.iter().cloned(), &mut bodies.clone());