reth_transaction_pool

Trait EthPoolTransaction

Source
pub trait EthPoolTransaction: PoolTransaction {
    // Required methods
    fn take_blob(&mut self) -> EthBlobTransactionSidecar;
    fn blob_count(&self) -> usize;
    fn try_into_pooled_eip4844(
        self,
        sidecar: Arc<BlobTransactionSidecar>,
    ) -> Option<RecoveredTx<Self::Pooled>>;
    fn try_from_eip4844(
        tx: RecoveredTx<Self::Consensus>,
        sidecar: BlobTransactionSidecar,
    ) -> Option<Self>;
    fn validate_blob(
        &self,
        blob: &BlobTransactionSidecar,
        settings: &KzgSettings,
    ) -> Result<(), BlobTransactionValidationError>;
    fn authorization_count(&self) -> usize;
}
Expand description

Super trait for transactions that can be converted to and from Eth transactions intended for the ethereum style pool.

This extends the PoolTransaction trait with additional methods that are specific to the Ethereum pool.

Required Methods§

Source

fn take_blob(&mut self) -> EthBlobTransactionSidecar

Extracts the blob sidecar from the transaction.

Source

fn blob_count(&self) -> usize

Returns the number of blobs this transaction has.

Source

fn try_into_pooled_eip4844( self, sidecar: Arc<BlobTransactionSidecar>, ) -> Option<RecoveredTx<Self::Pooled>>

A specialization for the EIP-4844 transaction type. Tries to reattach the blob sidecar to the transaction.

This returns an option, but callers should ensure that the transaction is an EIP-4844 transaction: PoolTransaction::is_eip4844.

Source

fn try_from_eip4844( tx: RecoveredTx<Self::Consensus>, sidecar: BlobTransactionSidecar, ) -> Option<Self>

Tries to convert the Consensus type with a blob sidecar into the Pooled type.

Returns None if passed transaction is not a blob transaction.

Source

fn validate_blob( &self, blob: &BlobTransactionSidecar, settings: &KzgSettings, ) -> Result<(), BlobTransactionValidationError>

Validates the blob sidecar of the transaction with the given settings.

Source

fn authorization_count(&self) -> usize

Returns the number of authorizations this transaction has.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl EthPoolTransaction for MockTransaction

Available on crate feature test-utils only.
Source§

impl EthPoolTransaction for EthPooledTransaction