Skip to content

Commit

Permalink
chore: relax mempool impl (#12865)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Nov 26, 2024
1 parent 13cd77c commit 9d2e04c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions crates/net/eth-wire-types/src/broadcast.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
//! Types for broadcasting new data.
use crate::{EthMessage, EthVersion, NetworkPrimitives};
use alloy_primitives::{Bytes, TxHash, B256, U128};
use alloy_rlp::{
Decodable, Encodable, RlpDecodable, RlpDecodableWrapper, RlpEncodable, RlpEncodableWrapper,
};

use alloy_primitives::{Bytes, TxHash, B256, U128};
use derive_more::{Constructor, Deref, DerefMut, From, IntoIterator};
use reth_codecs_derive::{add_arbitrary_tests, generate_tests};
use reth_primitives::{PooledTransactionsElement, TransactionSigned};

use reth_primitives::TransactionSigned;
use reth_primitives_traits::SignedTransaction;
use std::{
collections::{HashMap, HashSet},
mem,
Expand Down Expand Up @@ -555,7 +554,7 @@ pub trait HandleVersionedMempoolData {
fn msg_version(&self) -> EthVersion;
}

impl HandleMempoolData for Vec<PooledTransactionsElement> {
impl<T: SignedTransaction> HandleMempoolData for Vec<T> {
fn is_empty(&self) -> bool {
self.is_empty()
}
Expand All @@ -565,7 +564,7 @@ impl HandleMempoolData for Vec<PooledTransactionsElement> {
}

fn retain_by_hash(&mut self, mut f: impl FnMut(&TxHash) -> bool) {
self.retain(|tx| f(tx.hash()))
self.retain(|tx| f(tx.tx_hash()))
}
}

Expand Down

0 comments on commit 9d2e04c

Please sign in to comment.