|
1 | 1 | use alloy_primitives::{Address, TxHash}; |
2 | 2 | use reth_payload_util::PayloadTransactions; |
3 | | -use reth_transaction_pool::PoolTransaction; |
4 | | -use std::collections::HashSet; |
| 3 | +use reth_transaction_pool::{PoolTransaction, ValidPoolTransaction}; |
| 4 | +use std::{collections::HashSet, sync::Arc}; |
5 | 5 | use tracing::debug; |
6 | 6 |
|
7 | 7 | use crate::tx::MaybeFlashblockFilter; |
8 | 8 |
|
9 | 9 | pub(super) struct BestFlashblocksTxs<T, I> |
10 | 10 | where |
11 | 11 | T: PoolTransaction, |
12 | | - I: PayloadTransactions<Transaction = T>, |
| 12 | + I: Iterator<Item = Arc<ValidPoolTransaction<T>>>, |
13 | 13 | { |
14 | | - inner: I, |
| 14 | + inner: reth_payload_util::BestPayloadTransactions<T, I>, |
15 | 15 | current_flashblock_number: u64, |
16 | 16 | // Transactions that were already commited to the state. Using them again would cause NonceTooLow |
17 | 17 | // so we skip them |
|
21 | 21 | impl<T, I> BestFlashblocksTxs<T, I> |
22 | 22 | where |
23 | 23 | T: PoolTransaction, |
24 | | - I: PayloadTransactions<Transaction = T>, |
| 24 | + I: Iterator<Item = Arc<ValidPoolTransaction<T>>>, |
25 | 25 | { |
26 | | - pub(super) fn new(inner: I) -> Self { |
| 26 | + pub(super) fn new(inner: reth_payload_util::BestPayloadTransactions<T, I>) -> Self { |
27 | 27 | Self { |
28 | 28 | inner, |
29 | 29 | current_flashblock_number: 0, |
|
33 | 33 |
|
34 | 34 | /// Replaces current iterator with new one. We use it on new flashblock building, to refresh |
35 | 35 | /// priority boundaries |
36 | | - pub(super) fn refresh_iterator(&mut self, inner: I, current_flashblock_number: u64) { |
| 36 | + pub(super) fn refresh_iterator( |
| 37 | + &mut self, |
| 38 | + inner: reth_payload_util::BestPayloadTransactions<T, I>, |
| 39 | + current_flashblock_number: u64, |
| 40 | + ) { |
37 | 41 | self.inner = inner; |
38 | 42 | self.current_flashblock_number = current_flashblock_number; |
39 | 43 | } |
|
47 | 51 | impl<T, I> PayloadTransactions for BestFlashblocksTxs<T, I> |
48 | 52 | where |
49 | 53 | T: PoolTransaction + MaybeFlashblockFilter, |
50 | | - I: PayloadTransactions<Transaction = T>, |
| 54 | + I: Iterator<Item = Arc<ValidPoolTransaction<T>>>, |
51 | 55 | { |
52 | 56 | type Transaction = T; |
53 | 57 |
|
|
0 commit comments