#[non_exhaustive]pub enum OpReceiptEnvelope<T = Log> {
Legacy(ReceiptWithBloom<T>),
Eip2930(ReceiptWithBloom<T>),
Eip1559(ReceiptWithBloom<T>),
Eip4844(ReceiptWithBloom<T>),
Deposit(OpDepositReceiptWithBloom<T>),
}
Expand description
Receipt envelope, as defined in EIP-2718, modified for OP Stack chains.
This enum distinguishes between tagged and untagged legacy receipts, as the
in-protocol merkle tree may commit to EITHER 0-prefixed or raw. Therefore
we must ensure that encoding returns the precise byte-array that was
decoded, preserving the presence or absence of the TransactionType
flag.
Transaction receipt payloads are specified in their respective EIPs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Legacy(ReceiptWithBloom<T>)
Receipt envelope with no type flag.
Eip2930(ReceiptWithBloom<T>)
Receipt envelope with type flag 1, containing a EIP-2930 receipt.
Eip1559(ReceiptWithBloom<T>)
Receipt envelope with type flag 2, containing a EIP-1559 receipt.
Eip4844(ReceiptWithBloom<T>)
Receipt envelope with type flag 2, containing a EIP-4844 receipt.
Deposit(OpDepositReceiptWithBloom<T>)
Receipt envelope with type flag 126, containing a deposit receipt.
Implementations§
source§impl<T> OpReceiptEnvelope<T>
impl<T> OpReceiptEnvelope<T>
sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Return true if the transaction was successful.
sourcepub fn cumulative_gas_used(&self) -> u128
pub fn cumulative_gas_used(&self) -> u128
Returns the cumulative gas used at this receipt.
sourcepub const fn logs_bloom(&self) -> &Bloom
pub const fn logs_bloom(&self) -> &Bloom
Return the receipt’s bloom.
sourcepub fn deposit_nonce(&self) -> Option<u64>
pub fn deposit_nonce(&self) -> Option<u64>
Return the receipt’s deposit_nonce if it is a deposit receipt.
sourcepub fn deposit_receipt_version(&self) -> Option<u64>
pub fn deposit_receipt_version(&self) -> Option<u64>
Return the receipt’s deposit version if it is a deposit receipt.
sourcepub const fn as_deposit_receipt_with_bloom(
&self,
) -> Option<&OpDepositReceiptWithBloom<T>>
pub const fn as_deposit_receipt_with_bloom( &self, ) -> Option<&OpDepositReceiptWithBloom<T>>
Returns the deposit receipt if it is a deposit receipt.
sourcepub const fn as_deposit_receipt(&self) -> Option<&OpDepositReceipt<T>>
pub const fn as_deposit_receipt(&self) -> Option<&OpDepositReceipt<T>>
Returns the deposit receipt if it is a deposit receipt.
sourcepub const fn as_receipt(&self) -> Option<&Receipt<T>>
pub const fn as_receipt(&self) -> Option<&Receipt<T>>
Return the inner receipt. Currently this is infallible, however, future receipt types may be added.
source§impl OpReceiptEnvelope
impl OpReceiptEnvelope
sourcepub fn inner_length(&self) -> usize
pub fn inner_length(&self) -> usize
Get the length of the inner receipt in the 2718 encoding.
sourcepub fn rlp_payload_length(&self) -> usize
pub fn rlp_payload_length(&self) -> usize
Calculate the length of the rlp payload of the network encoded receipt.
Trait Implementations§
source§impl<T: Clone> Clone for OpReceiptEnvelope<T>
impl<T: Clone> Clone for OpReceiptEnvelope<T>
source§fn clone(&self) -> OpReceiptEnvelope<T>
fn clone(&self) -> OpReceiptEnvelope<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T: Debug> Debug for OpReceiptEnvelope<T>
impl<T: Debug> Debug for OpReceiptEnvelope<T>
source§impl Decodable for OpReceiptEnvelope
impl Decodable for OpReceiptEnvelope
source§impl Decodable2718 for OpReceiptEnvelope
impl Decodable2718 for OpReceiptEnvelope
source§fn typed_decode(ty: u8, buf: &mut &[u8]) -> Eip2718Result<Self>
fn typed_decode(ty: u8, buf: &mut &[u8]) -> Eip2718Result<Self>
source§fn fallback_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
fn fallback_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
§fn extract_type_byte(buf: &mut &[u8]) -> Option<u8>
fn extract_type_byte(buf: &mut &[u8]) -> Option<u8>
§fn decode_2718(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
fn decode_2718(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
source§impl<'de, T> Deserialize<'de> for OpReceiptEnvelope<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for OpReceiptEnvelope<T>where
T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Encodable for OpReceiptEnvelope
impl Encodable for OpReceiptEnvelope
source§impl Encodable2718 for OpReceiptEnvelope
impl Encodable2718 for OpReceiptEnvelope
source§fn encode_2718_len(&self) -> usize
fn encode_2718_len(&self) -> usize
source§fn encode_2718(&self, out: &mut dyn BufMut)
fn encode_2718(&self, out: &mut dyn BufMut)
§fn encoded_2718(&self) -> Vec<u8> ⓘ
fn encoded_2718(&self) -> Vec<u8> ⓘ
§fn trie_hash(&self) -> FixedBytes<32>
fn trie_hash(&self) -> FixedBytes<32>
§fn network_encode(&self, out: &mut dyn BufMut)
fn network_encode(&self, out: &mut dyn BufMut)
source§impl<T: PartialEq> PartialEq for OpReceiptEnvelope<T>
impl<T: PartialEq> PartialEq for OpReceiptEnvelope<T>
source§impl<T> Serialize for OpReceiptEnvelope<T>where
T: Serialize,
impl<T> Serialize for OpReceiptEnvelope<T>where
T: Serialize,
source§impl<T> TxReceipt<T> for OpReceiptEnvelope<T>
impl<T> TxReceipt<T> for OpReceiptEnvelope<T>
source§fn cumulative_gas_used(&self) -> u128
fn cumulative_gas_used(&self) -> u128
Returns the cumulative gas used at this receipt.
source§fn status_or_post_state(&self) -> Eip658Value
fn status_or_post_state(&self) -> Eip658Value
source§fn bloom_cheap(&self) -> Option<Bloom>
fn bloom_cheap(&self) -> Option<Bloom>
impl<T: Eq> Eq for OpReceiptEnvelope<T>
impl<T> StructuralPartialEq for OpReceiptEnvelope<T>
Auto Trait Implementations§
impl<T> Freeze for OpReceiptEnvelope<T>
impl<T> RefUnwindSafe for OpReceiptEnvelope<T>where
T: RefUnwindSafe,
impl<T> Send for OpReceiptEnvelope<T>where
T: Send,
impl<T> Sync for OpReceiptEnvelope<T>where
T: Sync,
impl<T> Unpin for OpReceiptEnvelope<T>where
T: Unpin,
impl<T> UnwindSafe for OpReceiptEnvelope<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Eip2718Envelope for Twhere
T: Decodable2718 + Encodable2718,
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: 368 bytes
Size for each variant:
Legacy
: 352 bytesEip2930
: 352 bytesEip1559
: 352 bytesEip4844
: 352 bytesDeposit
: 368 bytes