Type Alias MockTxPool

Source
pub type MockTxPool = TxPool<MockOrdering>;
Available on crate feature test-utils only.
Expand description

A transaction pool implementation using MockOrdering for transaction ordering.

This type is an alias for TxPool<MockOrdering>.

Aliased Type§

struct MockTxPool { /* private fields */ }

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 1456 bytes

Implementations

Source§

impl TxPool<MockOrdering>

Source

pub fn mock() -> Self

Creates a mock instance for testing.

Source§

impl<T: TransactionOrdering> TxPool<T>

Source

pub fn new(ordering: T, config: PoolConfig) -> Self

Create a new graph pool instance.

Source

pub fn get_highest_nonce_by_sender(&self, sender: SenderId) -> Option<u64>

Retrieves the highest nonce for a specific sender from the transaction pool.

Source

pub fn get_highest_transaction_by_sender( &self, sender: SenderId, ) -> Option<Arc<ValidPoolTransaction<T::Transaction>>>

Retrieves the highest transaction (wrapped in an Arc) for a specific sender from the transaction pool.

Source

pub fn size(&self) -> PoolSize

Returns stats about the size of pool.

Source

pub const fn block_info(&self) -> BlockInfo

Returns the currently tracked block values

Source

pub fn set_block_info(&mut self, info: BlockInfo)

Sets the current block info for the pool.

This will also apply updates to the pool based on the new base fee

Source

pub fn queued_and_pending_txs_by_sender( &self, sender: SenderId, ) -> (SmallVec<[TransactionId; 16]>, Vec<TransactionId>)

Returns queued and pending transactions for the specified sender

Source

pub fn assert_invariants(&self)

Asserts all invariants of the pool’s:

  • All maps are bijections (by_id, by_hash)
  • Total size is equal to the sum of all sub-pools
§Panics

if any invariant is violated

Trait Implementations

Source§

impl<T: TransactionOrdering> Debug for TxPool<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more