pub struct Receipt {
pub tx_type: TxType,
pub succeeded: bool,
pub cumulative_gas_used: u64,
pub logs: Vec<Log>,
pub payer: Option<Address>,
pub frame_receipts: Option<Vec<FrameReceipt>>,
}Expand description
Result of a transaction
Fields§
§tx_type: TxType§succeeded: bool§cumulative_gas_used: u64Cumulative gas used by this and all previous transactions in the block. This is always post-refund gas. Note: Block-level gas accounting (pre-refund for EIP-7778) uses BlockExecutionResult::block_gas_used.
logs: Vec<Log>§payer: Option<Address>For frame transactions: the address that paid for gas (set by APPROVE)
frame_receipts: Option<Vec<FrameReceipt>>For frame transactions: per-frame execution results
Implementations§
Source§impl Receipt
impl Receipt
pub fn new( tx_type: TxType, succeeded: bool, cumulative_gas_used: u64, logs: Vec<Log>, ) -> Self
pub fn encode_inner(&self) -> Vec<u8> ⓘ
Sourcepub fn encode_storage(&self) -> Vec<u8> ⓘ
pub fn encode_storage(&self) -> Vec<u8> ⓘ
Full-fidelity INTERNAL storage encoding. NOT a wire/consensus format:
the receipts trie uses encode_inner_with_bloom and P2P uses the
RLPEncode impl (encode_inner). For frame receipts this additionally
persists succeeded and the aggregated top-level logs (needed by
eth_getLogs / eth_getTransactionReceipt), which the consensus layout
intentionally omits. Non-frame receipts reuse the existing layout so
databases written before this change stay readable.
Sourcepub fn decode_storage(rlp: &[u8]) -> Result<Receipt, RLPDecodeError>
pub fn decode_storage(rlp: &[u8]) -> Result<Receipt, RLPDecodeError>
Inverse of encode_storage.
pub fn encode_inner_with_bloom(&self, crypto: &dyn Crypto) -> Vec<u8> ⓘ
Sourcepub fn encode_inner_with_precomputed_bloom(&self, bloom: Bloom) -> Vec<u8> ⓘ
pub fn encode_inner_with_precomputed_bloom(&self, bloom: Bloom) -> Vec<u8> ⓘ
Like Self::encode_inner_with_bloom but takes an already-computed bloom, so
callers that also need the bloom for other purposes (e.g. the aggregate header
logs_bloom) don’t recompute it.
Sourcepub fn decode_inner_with_bloom(
rlp: &[u8],
) -> Result<(Receipt, &[u8]), RLPDecodeError>
pub fn decode_inner_with_bloom( rlp: &[u8], ) -> Result<(Receipt, &[u8]), RLPDecodeError>
Inverse of Receipt::encode_inner_with_bloom.
Parses a receipt from its consensus / trie byte form, i.e. the raw
tx_type || rlp(payload) (typed) or rlp(payload) (legacy) produced by
encode_inner_with_bloom. Returns the decoded receipt and the remaining
bytes after the consumed payload.
For non-frame receipts the layout is [succeeded, cumulative_gas_used, bloom, logs]; the bloom is dropped because Receipt does not store it.
For frame receipts (tx_type 0x06) the layout is the EIP-8141
[cumulative_gas_used, payer, [frame_receipt, ...]]: there is no
top-level succeeded (it is derived from the frame statuses, identical
to the RLPDecode for Receipt frame branch) and no top-level logs.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Receipt
impl<'de> Deserialize<'de> for Receipt
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>,
impl Eq for Receipt
Source§impl From<&Receipt> for ReceiptWithBloom
impl From<&Receipt> for ReceiptWithBloom
Source§impl From<&ReceiptWithBloom> for Receipt
impl From<&ReceiptWithBloom> for Receipt
Source§fn from(receipt: &ReceiptWithBloom) -> Self
fn from(receipt: &ReceiptWithBloom) -> Self
Source§impl RLPDecode for Receipt
impl RLPDecode for Receipt
fn decode_unfinished(rlp: &[u8]) -> Result<(Self, &[u8]), RLPDecodeError>
fn decode(rlp: &[u8]) -> Result<Self, RLPDecodeError>
impl StructuralPartialEq for Receipt
Auto Trait Implementations§
impl Freeze for Receipt
impl RefUnwindSafe for Receipt
impl Send for Receipt
impl Sync for Receipt
impl Unpin for Receipt
impl UnsafeUnpin for Receipt
impl UnwindSafe for Receipt
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.