pub struct FrameTxContext {
pub sender_approved: bool,
pub payer_address: Option<Address>,
pub frame_results: Vec<(u8, u64, Vec<Log>)>,
pub current_frame_index: usize,
pub sig_hash: H256,
pub tx: FrameTransaction,
pub approve_called_in_current_frame: bool,
pub total_gas_limit: u64,
}Expand description
Context for frame transaction (EIP-8141) execution. This is set when executing a frame transaction and is used by APPROVE, TXPARAM, FRAMEDATALOAD, and FRAMEDATACOPY opcodes.
Fields§
§sender_approved: boolWhether the sender has approved (APPROVE scope APPROVE_EXECUTION or
APPROVE_EXECUTION_AND_PAYMENT).
payer_address: Option<Address>The address that approved payment, set by APPROVE_PAYMENT or
APPROVE_EXECUTION_AND_PAYMENT. Per the latest EIP-8141 spec this is the
single source of truth for whether payment has been approved: when this
is Some(_), the transaction has a payer; when None, it does not.
frame_results: Vec<(u8, u64, Vec<Log>)>Per-frame execution results (status, gas_used, logs).
status is a FRAME_RECEIPT_STATUS_* code (0 = failure, 1 = success,
3 = skipped due to failed atomic batch).
current_frame_index: usizeIndex of the currently executing frame
sig_hash: H256The sig_hash of the frame transaction
tx: FrameTransactionThe full frame transaction (for TXPARAM access)
approve_called_in_current_frame: boolWhether APPROVE was called in the current frame
total_gas_limit: u64Cached FrameTransaction::total_gas_limit(). Computing it re-encodes
every frame and signature, so it must not run per-opcode (TXPARAM 0x06,
compute_tx_max_cost). Computed once at tx entry.
Implementations§
Source§impl FrameTxContext
impl FrameTxContext
Sourcepub fn approval_snapshot(&self) -> (bool, Option<Address>)
pub fn approval_snapshot(&self) -> (bool, Option<Address>)
Capture the approval state at atomic-batch entry. A batch revert rolls back the payer’s balance deduction and the sender nonce increment, so approvals granted inside the batch must be rolled back with it — otherwise a reverted APPROVE would leave the transaction authorized by a frame whose effects no longer exist.
Sourcepub fn restore_approvals(&mut self, snapshot: (bool, Option<Address>))
pub fn restore_approvals(&mut self, snapshot: (bool, Option<Address>))
Restore the approval state captured by approval_snapshot when the
enclosing atomic batch reverts. Approvals granted before the batch
are unaffected (the snapshot includes them).
Trait Implementations§
Source§impl Clone for FrameTxContext
impl Clone for FrameTxContext
Source§fn clone(&self) -> FrameTxContext
fn clone(&self) -> FrameTxContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for FrameTxContext
impl RefUnwindSafe for FrameTxContext
impl Send for FrameTxContext
impl Sync for FrameTxContext
impl Unpin for FrameTxContext
impl UnsafeUnpin for FrameTxContext
impl UnwindSafe for FrameTxContext
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,
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.