pub type MockTxPool = TxPool<MockOrdering>;
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<T: TransactionOrdering> TxPool<T>
impl<T: TransactionOrdering> TxPool<T>
Sourcepub fn new(ordering: T, config: PoolConfig) -> Self
pub fn new(ordering: T, config: PoolConfig) -> Self
Create a new graph pool instance.
Sourcepub fn get_highest_nonce_by_sender(&self, sender: SenderId) -> Option<u64>
pub fn get_highest_nonce_by_sender(&self, sender: SenderId) -> Option<u64>
Retrieves the highest nonce for a specific sender from the transaction pool.
Sourcepub fn get_highest_transaction_by_sender(
&self,
sender: SenderId,
) -> Option<Arc<ValidPoolTransaction<T::Transaction>>>
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.
Sourcepub const fn block_info(&self) -> BlockInfo
pub const fn block_info(&self) -> BlockInfo
Returns the currently tracked block values
Sourcepub fn set_block_info(&mut self, info: BlockInfo)
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
Sourcepub fn queued_and_pending_txs_by_sender(
&self,
sender: SenderId,
) -> (SmallVec<[TransactionId; 16]>, Vec<TransactionId>)
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
Sourcepub fn assert_invariants(&self)
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