Enum ReturnErrorCode

Source
#[repr(u32)]
pub enum ReturnErrorCode { Success = 0, CalleeTrapped = 1, CalleeReverted = 2, KeyNotFound = 3, TransferFailed = 4, OutOfResources = 5, EcdsaRecoveryFailed = 7, Sr25519VerifyFailed = 8, DuplicateContractAddress = 11, Unknown = 12, }
Expand description

Every error that can be returned to a contract when it calls any of the host functions.

Variants§

§

Success = 0

API call successful.

§

CalleeTrapped = 1

The called function trapped and has its state changes reverted. In this case no output buffer is returned. Can only be returned from call and instantiate.

§

CalleeReverted = 2

The called function ran to completion but decided to revert its state. An output buffer is returned when one was supplied. Can only be returned from call and instantiate.

§

KeyNotFound = 3

The passed key does not exist in storage.

§

TransferFailed = 4

Transfer failed for other not further specified reason. Most probably reserved or locked balance of the sender that was preventing the transfer.

§

OutOfResources = 5

The subcall ran out of weight or storage deposit.

§

EcdsaRecoveryFailed = 7

ECDSA public key recovery failed. Most probably wrong recovery id or signature.

§

Sr25519VerifyFailed = 8

sr25519 signature verification failed.

§

DuplicateContractAddress = 11

Contract instantiation failed because the address already exists. Occurs when instantiating the same contract with the same salt more than once.

§

Unknown = 12

Returns if an unknown error was received from the host module.

Trait Implementations§

Source§

impl Debug for ReturnErrorCode

Source§

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

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

impl From<ReturnErrorCode> for u32

Source§

fn from(code: ReturnErrorCode) -> u32

Converts to this type from the input type.
Source§

impl From<ReturnErrorCode> for u64

Source§

fn from(error: ReturnErrorCode) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ReturnErrorCode

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ReturnErrorCode

Source§

impl StructuralPartialEq for ReturnErrorCode

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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> JsonSchemaMaybe for T