Type Alias MockTxPool

pub type MockTxPool = TxPool<CoinbaseTipOrdering<MockTransaction>>;
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

§

impl TxPool<CoinbaseTipOrdering<MockTransaction>>

pub fn mock() -> TxPool<CoinbaseTipOrdering<MockTransaction>>

Creates a mock instance for testing.

§

impl<T> TxPool<T>

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

Create a new graph pool instance.

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

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

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

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

pub fn size(&self) -> PoolSize

Returns stats about the size of pool.

pub const fn block_info(&self) -> BlockInfo

Returns the currently tracked block values

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

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

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

§

impl<T> Debug for TxPool<T>

§

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

Formats the value using the given formatter. Read more