chore: remove test structs that are never constructed (#7107)

This commit is contained in:
Dan Cline
2024-03-11 23:59:13 -04:00
committed by GitHub
parent ff56ce42d7
commit 9707cb2b8d
2 changed files with 0 additions and 46 deletions

View File

@@ -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 {

View File

@@ -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 {