Enum cfx_vm_types::Error

source ·
pub enum Error {
Show 19 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, NotEnoughBalanceForStorage { required: U256, got: U256, }, ExceedStorageLimit, BuiltIn(&'static str), InternalContract(String), MutableCallInStaticContext, StateDbError(PartialEqWrapper<Error>), Wasm(String), OutOfBounds, Reverted, InvalidAddress(Address), ConflictAddress(Address),
}
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

SubStackUnderflow when there is not enough stack elements to execute a subroutine return

§

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

§

NotEnoughBalanceForStorage

Fields

§required: U256
§got: U256

When balance is not enough for collateral_for_storage. The state should be reverted to the state from before the transaction execution.

§

ExceedStorageLimit

ExceedStorageLimit is returned when the collateral_for_storage exceed the storage_limit.

§

BuiltIn(&'static str)

Built-in contract failed on given input

§

InternalContract(String)

Internal contract failed

§

MutableCallInStaticContext

When execution tries to modify the state in static context

§

StateDbError(PartialEqWrapper<Error>)

Error from storage.

§

Wasm(String)

Wasm runtime error

§

OutOfBounds

Out of bounds access in RETURNDATACOPY.

§

Reverted

Execution has been reverted with REVERT.

§

InvalidAddress(Address)

Invalid address

§

ConflictAddress(Address)

Create a contract on an address with existing contract

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<ABIDecodeError> for Error

source§

fn from(err: ABIDecodeError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(err: DbError) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Error

source§

fn eq(&self, other: &Error) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V