Skip to content

Commit

Permalink
chore: rm TransactionFilter (#12066)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Oct 25, 2024
1 parent 07bda5d commit 09506aa
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions crates/transaction-pool/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,25 +815,6 @@ where
}
}

/// A subtrait on the [`BestTransactions`] trait that allows to filter transactions.
pub trait BestTransactionsFilter: BestTransactions {
/// Creates an iterator which uses a closure to determine if a transaction should be yielded.
///
/// Given an element the closure must return true or false. The returned iterator will yield
/// only the elements for which the closure returns true.
///
/// Descendant transactions will be skipped.
fn filter<P>(self, predicate: P) -> BestTransactionFilter<Self, P>
where
P: FnMut(&Self::Item) -> bool,
Self: Sized,
{
BestTransactionFilter::new(self, predicate)
}
}

impl<T> BestTransactionsFilter for T where T: BestTransactions {}

/// A no-op implementation that yields no transactions.
impl<T> BestTransactions for std::iter::Empty<T> {
fn mark_invalid(&mut self, _tx: &T) {}
Expand Down

0 comments on commit 09506aa

Please sign in to comment.