Trait alloy_consensus::TxReceipt

source ·
pub trait TxReceipt: Clone + Debug + PartialEq + Eq + Send + Sync {
    type Log;

    // Required methods
    fn status_or_post_state(&self) -> Eip658Value;
    fn status(&self) -> bool;
    fn bloom(&self) -> Bloom;
    fn cumulative_gas_used(&self) -> u64;
    fn logs(&self) -> &[Self::Log];

    // Provided methods
    fn bloom_cheap(&self) -> Option<Bloom> { ... }
    fn with_bloom_ref(&self) -> ReceiptWithBloom<&Self> { ... }
    fn into_with_bloom(self) -> ReceiptWithBloom<Self> { ... }
}
Expand description

Receipt is the result of a transaction execution.

Required Associated Types§

source

type Log

The associated log type.

Required Methods§

source

fn status_or_post_state(&self) -> Eip658Value

Returns the status or post state of the transaction.

§Note

Use this method instead of TxReceipt::status when the transaction is pre-EIP-658.

source

fn status(&self) -> bool

Returns true if the transaction was successful OR if the transaction is pre-EIP-658. Results for transactions before EIP-658 are not reliable.

§Note

Caution must be taken when using this method for deep-historical receipts, as it may not accurately reflect the status of the transaction. The transaction status is not knowable from the receipt for transactions before EIP-658.

This can be handled using TxReceipt::status_or_post_state.

source

fn bloom(&self) -> Bloom

Returns the bloom filter for the logs in the receipt. This operation may be expensive.

source

fn cumulative_gas_used(&self) -> u64

Returns the cumulative gas used in the block after this transaction was executed.

source

fn logs(&self) -> &[Self::Log]

Returns the logs emitted by this transaction.

Provided Methods§

source

fn bloom_cheap(&self) -> Option<Bloom>

Returns the bloom filter for the logs in the receipt, if it is cheap to compute.

source

fn with_bloom_ref(&self) -> ReceiptWithBloom<&Self>

Returns ReceiptWithBloom with the computed bloom filter Self::bloom and a reference to the receipt.

source

fn into_with_bloom(self) -> ReceiptWithBloom<Self>

Consumes the type and converts it into ReceiptWithBloom with the computed bloom filter Self::bloom and the receipt.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a, T: 'a + TxReceipt + ?Sized> TxReceipt for &'a T
where &'a T: Clone + Debug + PartialEq + Eq + Send + Sync,

§

type Log = <T as TxReceipt>::Log

source§

fn status_or_post_state(&self) -> Eip658Value

source§

fn status(&self) -> bool

source§

fn bloom(&self) -> Bloom

source§

fn bloom_cheap(&self) -> Option<Bloom>

source§

fn cumulative_gas_used(&self) -> u64

source§

fn logs(&self) -> &[Self::Log]

source§

impl<T: TxReceipt + ?Sized> TxReceipt for Arc<T>
where Arc<T>: Clone + Debug + PartialEq + Eq + Send + Sync,

§

type Log = <T as TxReceipt>::Log

source§

fn status_or_post_state(&self) -> Eip658Value

source§

fn status(&self) -> bool

source§

fn bloom(&self) -> Bloom

source§

fn bloom_cheap(&self) -> Option<Bloom>

source§

fn cumulative_gas_used(&self) -> u64

source§

fn logs(&self) -> &[Self::Log]

Implementors§

source§

impl<R> TxReceipt for ReceiptWithBloom<R>
where R: TxReceipt,

§

type Log = <R as TxReceipt>::Log

source§

impl<T> TxReceipt for ReceiptEnvelope<T>
where T: Clone + Debug + PartialEq + Eq + Send + Sync,

§

type Log = T

source§

impl<T> TxReceipt for Receipt<T>
where T: AsRef<Log> + Clone + Debug + PartialEq + Eq + Send + Sync,

§

type Log = T