pub struct TransactionReceipt<T = ReceiptEnvelope<Log>> {
Show 13 fields pub inner: T, pub transaction_hash: TxHash, pub transaction_index: Option<u64>, pub block_hash: Option<BlockHash>, pub block_number: Option<u64>, pub gas_used: u128, pub effective_gas_price: u128, pub blob_gas_used: Option<u128>, pub blob_gas_price: Option<u128>, pub from: Address, pub to: Option<Address>, pub contract_address: Option<Address>, pub state_root: Option<B256>,
}
Expand description

Transaction receipt

This type is generic over an inner ReceiptEnvelope which contains consensus data and metadata.

Fields§

§inner: T

The receipt envelope, which contains the consensus receipt data..

§transaction_hash: TxHash

Transaction Hash.

§transaction_index: Option<u64>

Index within the block.

§block_hash: Option<BlockHash>

Hash of the block this transaction was included within.

§block_number: Option<u64>

Number of the block this transaction was included within.

§gas_used: u128

Gas used by this transaction alone.

§effective_gas_price: u128

The price paid post-execution by the transaction (i.e. base fee + priority fee). Both fields in 1559-style transactions are maximums (max fee + max priority fee), the amount that’s actually paid by users can only be determined post-execution

§blob_gas_used: Option<u128>

Blob gas used by the eip-4844 transaction

This is None for non eip-4844 transactions

§blob_gas_price: Option<u128>

The price paid by the eip-4844 transaction per blob gas.

§from: Address

Address of the sender

§to: Option<Address>

Address of the receiver. None when its a contract creation transaction.

§contract_address: Option<Address>

Contract address created, or None if not a deployment.

§state_root: Option<B256>

The post-transaction stateroot (pre Byzantium)

EIP98 makes this optional field, if it’s missing then skip serializing it

Implementations§

source§

impl TransactionReceipt

source

pub const fn status(&self) -> bool

Returns the status of the transaction.

source

pub const fn transaction_type(&self) -> TxType

Returns the transaction type.

source

pub fn calculate_create_address(&self, nonce: u64) -> Option<Address>

Calculates the address that will be created by the transaction, if any.

Returns None if the transaction is not a contract creation (the to field is set), or if the from field is not set.

source§

impl<T> TransactionReceipt<T>

source

pub fn map_inner<U, F>(self, f: F) -> TransactionReceipt<U>
where F: FnOnce(T) -> U,

Maps the inner receipt value of this receipt.

Trait Implementations§

source§

impl<'arbitrary, T: Arbitrary<'arbitrary>> Arbitrary<'arbitrary> for TransactionReceipt<T>

source§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
source§

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
source§

impl<T: Arbitrary> Arbitrary for TransactionReceipt<T>

§

type Parameters = (<T as Arbitrary>::Parameters, <FixedBytes<32> as Arbitrary>::Parameters, <Option<u64> as Arbitrary>::Parameters, <Option<FixedBytes<32>> as Arbitrary>::Parameters, <Option<u64> as Arbitrary>::Parameters, <u128 as Arbitrary>::Parameters, <u128 as Arbitrary>::Parameters, <Option<u128> as Arbitrary>::Parameters, <Option<u128> as Arbitrary>::Parameters, (<Address as Arbitrary>::Parameters, <Option<Address> as Arbitrary>::Parameters, <Option<Address> as Arbitrary>::Parameters, <Option<FixedBytes<32>> as Arbitrary>::Parameters))

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
§

type Strategy = Map<(<T as Arbitrary>::Strategy, <FixedBytes<32> as Arbitrary>::Strategy, <Option<u64> as Arbitrary>::Strategy, <Option<FixedBytes<32>> as Arbitrary>::Strategy, <Option<u64> as Arbitrary>::Strategy, <u128 as Arbitrary>::Strategy, <u128 as Arbitrary>::Strategy, <Option<u128> as Arbitrary>::Strategy, <Option<u128> as Arbitrary>::Strategy, (<Address as Arbitrary>::Strategy, <Option<Address> as Arbitrary>::Strategy, <Option<Address> as Arbitrary>::Strategy, <Option<FixedBytes<32>> as Arbitrary>::Strategy)), fn(_: (T, FixedBytes<32>, Option<u64>, Option<FixedBytes<32>>, Option<u64>, u128, u128, Option<u128>, Option<u128>, (Address, Option<Address>, Option<Address>, Option<FixedBytes<32>>))) -> TransactionReceipt<T>>

The type of Strategy used to generate values of type Self.
source§

fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
source§

impl AsRef<ReceiptEnvelope<Log>> for TransactionReceipt

source§

fn as_ref(&self) -> &ReceiptEnvelope<Log>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T: Clone> Clone for TransactionReceipt<T>

source§

fn clone(&self) -> TransactionReceipt<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for TransactionReceipt<T>

source§

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

Formats the value using the given formatter. Read more
source§

impl<'de, T> Deserialize<'de> for TransactionReceipt<T>
where T: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T: PartialEq> PartialEq for TransactionReceipt<T>

source§

fn eq(&self, other: &TransactionReceipt<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Serialize for TransactionReceipt<T>
where T: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T: Eq> Eq for TransactionReceipt<T>

source§

impl<T> StructuralPartialEq for TransactionReceipt<T>

Auto Trait Implementations§

§

impl<T> Freeze for TransactionReceipt<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for TransactionReceipt<T>
where T: RefUnwindSafe,

§

impl<T> Send for TransactionReceipt<T>
where T: Send,

§

impl<T> Sync for TransactionReceipt<T>
where T: Sync,

§

impl<T> Unpin for TransactionReceipt<T>
where T: Unpin,

§

impl<T> UnwindSafe for TransactionReceipt<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.