mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-30 09:38:24 -05:00
chore: move on_canonical_state_change to TransactionPoolExt (#3422)
This commit is contained in:
@@ -251,10 +251,6 @@ where
|
||||
self.pool.block_info()
|
||||
}
|
||||
|
||||
fn on_canonical_state_change(&self, update: CanonicalStateUpdate) {
|
||||
self.pool.on_canonical_state_change(update);
|
||||
}
|
||||
|
||||
async fn add_transaction_and_subscribe(
|
||||
&self,
|
||||
origin: TransactionOrigin,
|
||||
@@ -373,6 +369,10 @@ where
|
||||
trace!(target: "txpool", "updating pool block info");
|
||||
self.pool.set_block_info(info)
|
||||
}
|
||||
|
||||
fn on_canonical_state_change(&self, update: CanonicalStateUpdate) {
|
||||
self.pool.on_canonical_state_change(update);
|
||||
}
|
||||
}
|
||||
|
||||
impl<V: TransactionValidator, T: TransactionOrdering> Clone for Pool<V, T> {
|
||||
|
||||
@@ -36,13 +36,6 @@ pub trait TransactionPool: Send + Sync + Clone {
|
||||
/// This tracks the block that the pool has last seen.
|
||||
fn block_info(&self) -> BlockInfo;
|
||||
|
||||
/// Event listener for when the pool needs to be updated
|
||||
///
|
||||
/// Implementers need to update the pool accordingly.
|
||||
/// For example the base fee of the pending block is determined after a block is mined which
|
||||
/// affects the dynamic fee requirement of pending transactions in the pool.
|
||||
fn on_canonical_state_change(&self, update: CanonicalStateUpdate);
|
||||
|
||||
/// Imports an _external_ transaction.
|
||||
///
|
||||
/// This is intended to be used by the network to insert incoming transactions received over the
|
||||
@@ -212,6 +205,13 @@ pub trait TransactionPool: Send + Sync + Clone {
|
||||
pub trait TransactionPoolExt: TransactionPool {
|
||||
/// Sets the current block info for the pool.
|
||||
fn set_block_info(&self, info: BlockInfo);
|
||||
|
||||
/// Event listener for when the pool needs to be updated
|
||||
///
|
||||
/// Implementers need to update the pool accordingly.
|
||||
/// For example the base fee of the pending block is determined after a block is mined which
|
||||
/// affects the dynamic fee requirement of pending transactions in the pool.
|
||||
fn on_canonical_state_change(&self, update: CanonicalStateUpdate);
|
||||
}
|
||||
|
||||
/// A Helper type that bundles all transactions in the pool.
|
||||
|
||||
Reference in New Issue
Block a user