mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-30 01:28:21 -05:00
chore: remove test structs that are never constructed (#7107)
This commit is contained in:
@@ -13,9 +13,7 @@ use reth_interfaces::p2p::error::RequestResult;
|
||||
use reth_primitives::{BlockBody, BlockHashOrNumber, Header, HeadersDirection, PeerId};
|
||||
use reth_provider::{BlockReader, HeaderProvider, ReceiptProvider};
|
||||
use std::{
|
||||
borrow::Borrow,
|
||||
future::Future,
|
||||
hash::Hash,
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
@@ -275,21 +273,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents a handled [`GetBlockHeaders`] requests
|
||||
///
|
||||
/// This is the key type for spam detection cache. The counter is ignored during `PartialEq` and
|
||||
/// `Hash`.
|
||||
#[derive(Debug, PartialEq, Hash)]
|
||||
struct RespondedGetBlockHeaders {
|
||||
req: (PeerId, GetBlockHeaders),
|
||||
}
|
||||
|
||||
impl Borrow<(PeerId, GetBlockHeaders)> for RespondedGetBlockHeaders {
|
||||
fn borrow(&self) -> &(PeerId, GetBlockHeaders) {
|
||||
&self.req
|
||||
}
|
||||
}
|
||||
|
||||
/// All `eth` request related to blocks delegated by the network.
|
||||
#[derive(Debug)]
|
||||
pub enum IncomingEthRequest {
|
||||
|
||||
@@ -587,13 +587,10 @@ mod tests {
|
||||
use reth_interfaces::{
|
||||
p2p::{
|
||||
bodies::{
|
||||
client::{BodiesClient, BodiesFut},
|
||||
downloader::{BodyDownloader, BodyDownloaderResult},
|
||||
response::BlockResponse,
|
||||
},
|
||||
download::DownloadClient,
|
||||
error::DownloadResult,
|
||||
priority::Priority,
|
||||
},
|
||||
test_utils::{
|
||||
generators,
|
||||
@@ -844,32 +841,6 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
/// A [BodiesClient] that should not be called.
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct NoopClient;
|
||||
|
||||
impl DownloadClient for NoopClient {
|
||||
fn report_bad_message(&self, _: reth_primitives::PeerId) {
|
||||
panic!("Noop client should not be called")
|
||||
}
|
||||
|
||||
fn num_connected_peers(&self) -> usize {
|
||||
panic!("Noop client should not be called")
|
||||
}
|
||||
}
|
||||
|
||||
impl BodiesClient for NoopClient {
|
||||
type Output = BodiesFut;
|
||||
|
||||
fn get_block_bodies_with_priority(
|
||||
&self,
|
||||
_hashes: Vec<B256>,
|
||||
_priority: Priority,
|
||||
) -> Self::Output {
|
||||
panic!("Noop client should not be called")
|
||||
}
|
||||
}
|
||||
|
||||
/// A [BodyDownloader] that is backed by an internal [HashMap] for testing.
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct TestBodyDownloader {
|
||||
|
||||
Reference in New Issue
Block a user