alloy_consensus

Trait TxReceipt

Source
pub trait TxReceipt<T = Log>:
    Clone
    + Debug
    + PartialEq
    + Eq
    + Send
    + Sync {
    // Required methods
    fn status_or_post_state(&self) -> Eip658Value;
    fn status(&self) -> bool;
    fn bloom(&self) -> Bloom;
    fn cumulative_gas_used(&self) -> u128;
    fn logs(&self) -> &[T];

    // Provided method
    fn bloom_cheap(&self) -> Option<Bloom> { ... }
}
Expand description

Receipt is the result of a transaction execution.

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) -> u128

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

Source

fn logs(&self) -> &[T]

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.

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.

Implementations on Foreign Types§

Source§

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

Source§

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

Implementors§

Source§

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

Source§

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

Source§

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

Source§

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