pub enum Instruction {
Push(String),
Store {
slot: String,
},
Load {
slot: String,
},
Call {
target: String,
},
Log {
topic: String,
},
Add,
Sub,
RequireGte {
reason: String,
},
Transfer {
to: String,
},
Revert {
reason: String,
},
}Expand description
High-level instruction that the scenario compiler emits. Each maps to one or more low-level opcodes in the trace.
Variants§
Push(String)
Push a literal value onto the stack.
Store
Store top-of-stack into a named storage slot.
Load
Load a named storage slot onto the stack.
Call
Call a named function (creates a call frame in the trace).
Log
Emit a log event with a topic.
Add
Arithmetic: add top two stack values.
Sub
Arithmetic: subtract top two stack values (a - b where a is deeper).
RequireGte
Compare top two stack values; revert with reason if a < b.
Transfer
Transfer value externally (external CALL with value).
Revert
Explicitly revert with a reason.
Trait Implementations§
Source§impl Clone for Instruction
impl Clone for Instruction
Source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnsafeUnpin for Instruction
impl UnwindSafe for Instruction
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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