mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor: avoid using NoopTransactionPool in OP payload builder (#13547)
This commit is contained in:
@ -11,5 +11,5 @@
|
||||
mod traits;
|
||||
mod transaction;
|
||||
|
||||
pub use traits::PayloadTransactions;
|
||||
pub use traits::{NoopPayloadTransactions, PayloadTransactions};
|
||||
pub use transaction::{PayloadTransactionsChain, PayloadTransactionsFixed};
|
||||
|
||||
@ -21,3 +21,17 @@ pub trait PayloadTransactions {
|
||||
/// because this transaction won't be included in the block.
|
||||
fn mark_invalid(&mut self, sender: Address, nonce: u64);
|
||||
}
|
||||
|
||||
/// [`PayloadTransactions`] implementation that produces nothing.
|
||||
#[derive(Debug, Default, Clone, Copy)]
|
||||
pub struct NoopPayloadTransactions<T>(core::marker::PhantomData<T>);
|
||||
|
||||
impl<T> PayloadTransactions for NoopPayloadTransactions<T> {
|
||||
type Transaction = T;
|
||||
|
||||
fn next(&mut self, _ctx: ()) -> Option<RecoveredTx<Self::Transaction>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn mark_invalid(&mut self, _sender: Address, _nonce: u64) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user