diff --git a/p2p/p2p-core/src/client/handshaker.rs b/p2p/p2p-core/src/client/handshaker.rs index 5e9a5d5b..434c330f 100644 --- a/p2p/p2p-core/src/client/handshaker.rs +++ b/p2p/p2p-core/src/client/handshaker.rs @@ -222,7 +222,6 @@ pub async fn ping(addr: N::Addr) -> Result } /// This function completes a handshake with the requested peer. -#[expect(clippy::too_many_arguments)] async fn handshake( req: DoHandshakeRequest, diff --git a/p2p/p2p/src/block_downloader/tests.rs b/p2p/p2p/src/block_downloader/tests.rs index a25f90b8..0dfe42bf 100644 --- a/p2p/p2p/src/block_downloader/tests.rs +++ b/p2p/p2p/src/block_downloader/tests.rs @@ -20,8 +20,7 @@ use tower::{service_fn, Service}; use cuprate_fixed_bytes::ByteArrayVec; use cuprate_p2p_core::{ client::{mock_client, Client, InternalPeerID, PeerInformation}, - ClearNet, ConnectionDirection, PeerRequest, PeerResponse, ProtocolRequest, - ProtocolResponse, + ClearNet, ConnectionDirection, PeerRequest, PeerResponse, ProtocolRequest, ProtocolResponse, }; use cuprate_pruning::PruningSeed; use cuprate_types::{BlockCompleteEntry, TransactionBlobs}; @@ -52,13 +51,9 @@ proptest! { timeout(Duration::from_secs(600), async move { let client_pool = ClientPool::new(); - let mut peer_ids = Vec::with_capacity(peers); - for _ in 0..peers { let client = mock_block_downloader_client(Arc::clone(&blockchain)); - peer_ids.push(client.info.id); - client_pool.add_new_client(client); } diff --git a/p2p/p2p/src/constants.rs b/p2p/p2p/src/constants.rs index 047a36fa..f2349600 100644 --- a/p2p/p2p/src/constants.rs +++ b/p2p/p2p/src/constants.rs @@ -15,8 +15,8 @@ pub(crate) const MAX_SEED_CONNECTIONS: usize = 3; /// The timeout for when we fail to find a peer to connect to. pub(crate) const OUTBOUND_CONNECTION_ATTEMPT_TIMEOUT: Duration = Duration::from_secs(5); -#[allow(dead_code)] /// The durations of a short ban. +#[cfg_attr(not(test), expect(dead_code))] pub(crate) const SHORT_BAN: Duration = Duration::from_secs(60 * 10); /// The durations of a medium ban. diff --git a/p2p/p2p/src/lib.rs b/p2p/p2p/src/lib.rs index 97d61588..4a35aced 100644 --- a/p2p/p2p/src/lib.rs +++ b/p2p/p2p/src/lib.rs @@ -5,10 +5,7 @@ use std::sync::Arc; use futures::FutureExt; -use tokio::{ - sync::mpsc, - task::JoinSet, -}; +use tokio::{sync::mpsc, task::JoinSet}; use tower::{buffer::Buffer, util::BoxCloneService, Service, ServiceExt}; use tracing::{instrument, Instrument, Span};