pub enum Error {
Show 15 variants
OutOfGas,
BadJumpDestination {
destination: usize,
},
BadInstruction {
instruction: u8,
},
StackUnderflow {
instruction: &'static str,
wanted: usize,
on_stack: usize,
},
OutOfStack {
instruction: &'static str,
wanted: usize,
limit: usize,
},
SubStackUnderflow {
wanted: usize,
on_stack: usize,
},
OutOfSubStack {
wanted: usize,
limit: usize,
},
InvalidSubEntry,
BuiltIn(&'static str),
MutableCallInStaticContext,
InvalidCode,
Internal(String),
Wasm(String),
OutOfBounds,
Reverted,
}
Expand description
VM errors.
Variants
OutOfGas
OutOfGas
is returned when transaction execution runs out of gas.
The state should be reverted to the state from before the
transaction execution. But it does not mean that transaction
was invalid. Balance still should be transfered and nonce
should be increased.
BadJumpDestination
Fields
destination: usize
Position the code tried to jump to.
BadJumpDestination
is returned when execution tried to move
to position that wasn’t marked with JUMPDEST instruction
BadInstruction
Fields
instruction: u8
Unrecognized opcode
BadInstructions
is returned when given instruction is not supported
StackUnderflow
Fields
instruction: &'static str
Invoked instruction
wanted: usize
How many stack elements was requested by instruction
on_stack: usize
How many elements were on stack
StackUnderflow
when there is not enough stack elements to execute instruction
OutOfStack
Fields
instruction: &'static str
Invoked instruction
wanted: usize
How many stack elements instruction wanted to push
limit: usize
What was the stack limit
When execution would exceed defined Stack Limit
SubStackUnderflow
Fields
wanted: usize
How many stack elements was requested by instruction
on_stack: usize
How many elements were on stack
When there is not enough subroutine stack elements to return from
OutOfSubStack
Fields
wanted: usize
How many stack elements instruction wanted to pop
limit: usize
What was the stack limit
When execution would exceed defined subroutine Stack Limit
InvalidSubEntry
When the code walks into a subroutine, that is not allowed
BuiltIn(&'static str)
Built-in contract failed on given input
MutableCallInStaticContext
When execution tries to modify the state in static context
InvalidCode
Invalid code to deploy as a contract
Internal(String)
Likely to cause consensus issues.
Wasm(String)
Wasm runtime error
OutOfBounds
Out of bounds access in RETURNDATACOPY.
Reverted
Execution has been reverted with REVERT.
Trait Implementations
impl StructuralPartialEq for Error
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more