#[repr(u8)]
#[non_exhaustive]
pub enum PanicReason {
Show 36 variants Success, Revert, OutOfGas, TransactionValidity, MemoryOverflow, ArithmeticOverflow, ContractNotFound, MemoryOwnership, NotEnoughBalance, ExpectedInternalContext, AssetIdNotFound, InputNotFound, OutputNotFound, WitnessNotFound, TransactionMaturity, InvalidMetadataIdentifier, MalformedCallStructure, ReservedRegisterNotWritable, ErrorFlag, InvalidImmediateValue, ExpectedCoinInput, MaxMemoryAccess, MemoryWriteOverlap, ContractNotInInputs, InternalBalanceOverflow, ContractMaxSize, ExpectedUnallocatedStack, MaxStaticContractsReached, TransferAmountCannotBeZero, ExpectedOutputVariable, ExpectedParentInternalContext, IllegalJump, ContractIdAlreadyDeployed, ContractMismatch, MessageDataTooLong, UnknownPanicReason,
}
Expand description

Panic reason representation for the interpreter.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Success

0 is reserved for success, while any non-zero value indicates a failure.

§

Revert

Found RVRT instruction.

§

OutOfGas

Execution ran out of gas.

§

TransactionValidity

The transaction validity is violated.

§

MemoryOverflow

Attempt to write outside interpreter memory boundaries.

§

ArithmeticOverflow

Overflow while executing arithmetic operation.

§

ContractNotFound

Designed contract was not found in the storage.

§

MemoryOwnership

Memory ownership rules are violated.

§

NotEnoughBalance

The asset ID balance isn’t enough for the instruction.

§

ExpectedInternalContext

The interpreter is expected to be in internal context.

§

AssetIdNotFound

The queried asset ID was not found in the state.

§

InputNotFound

The provided input is not found in the transaction.

§

OutputNotFound

The provided output is not found in the transaction.

§

WitnessNotFound

The provided witness is not found in the transaction.

§

TransactionMaturity

The transaction maturity is not valid for this request.

§

InvalidMetadataIdentifier

The metadata identifier is invalid.

§

MalformedCallStructure

The call structure is not valid.

§

ReservedRegisterNotWritable

The provided register does not allow write operations.

§

ErrorFlag

The execution resulted in an erroneous state of the interpreter.

§

InvalidImmediateValue

The provided immediate value is not valid for this instruction.

§

ExpectedCoinInput

The provided transaction input is not of type Coin.

§

MaxMemoryAccess

The requested memory access exceeds the limits of the interpreter.

§

MemoryWriteOverlap

Two segments of the interpreter memory should not intersect for write operations.

§

ContractNotInInputs

The requested contract is not listed in the transaction inputs.

§

InternalBalanceOverflow

The internal asset ID balance overflowed with the provided instruction.

§

ContractMaxSize

The maximum allowed contract size is violated.

§

ExpectedUnallocatedStack

This instruction expects the stack area to be unallocated for this call.

§

MaxStaticContractsReached

The maximum allowed number of static contracts was reached for this transaction.

§

TransferAmountCannotBeZero

The requested transfer amount cannot be zero.

§

ExpectedOutputVariable

The provided transaction output should be of type Variable.

§

ExpectedParentInternalContext

The expected context of the stack parent is internal.

§

IllegalJump

The jump instruction cannot move backwards in predicate verification.

§

ContractIdAlreadyDeployed

The contract ID is already deployed and can’t be overwritten.

§

ContractMismatch

The loaded contract mismatch expectations.

§

MessageDataTooLong

Attempting to send message data longer than MAX_MESSAGE_DATA_LENGTH

§

UnknownPanicReason

The byte can’t be mapped to any known PanicReason.

Trait Implementations§

source§

impl<'arbitrary> Arbitrary<'arbitrary> for PanicReason

source§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
source§

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
source§

impl Clone for PanicReason

source§

fn clone(&self) -> PanicReason

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PanicReason

source§

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

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

impl<'de> Deserialize<'de> for PanicReason

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for PanicReason

source§

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

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

impl Error for PanicReason

Available on crate feature std only.
source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Infallible> for PanicReason

source§

fn from(_i: Infallible) -> Self

Converts to this type from the input type.
source§

impl From<PanicReason> for Error

Available on crate feature std only.
source§

fn from(reason: PanicReason) -> Self

Converts to this type from the input type.
source§

impl From<TryFromSliceError> for PanicReason

source§

fn from(_: TryFromSliceError) -> Self

Converts to this type from the input type.
source§

impl From<u8> for PanicReason

source§

fn from(b: u8) -> Self

Converts to this type from the input type.
source§

impl Hash for PanicReason

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<PanicReason> for PanicReason

source§

fn eq(&self, other: &PanicReason) -> 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 Serialize for PanicReason

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for PanicReason

source§

impl Eq for PanicReason

source§

impl StructuralEq for PanicReason

source§

impl StructuralPartialEq for PanicReason

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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<E> Provider for Ewhere E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere 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 Twhere 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 Twhere 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.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,