#[non_exhaustive]
#[repr(u8)]
pub enum Error {
Show 22 variants InsufficientFunds = 0, SourceNotFound = 1, DestNotFound = 2, InvalidURef = 3, InvalidAccessRights = 4, InvalidNonEmptyPurseCreation = 5, Storage = 6, PurseNotFound = 7, MissingKey = 8, TotalSupplyNotFound = 9, RecordTransferFailure = 10, InvalidTotalSupplyReductionAttempt = 11, NewURef = 12, PutKey = 13, WriteDictionary = 14, CLValue = 15, Serialize = 16, EqualSourceAndTarget = 17, ArithmeticOverflow = 18, InvalidContext = 20, UnapprovedSpendingAmount = 21, DisabledUnrestrictedTransfers = 22,
}
Expand description

Errors which can occur while executing the Mint contract.

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.
§

InsufficientFunds = 0

Insufficient funds to complete the transfer.

assert_eq!(0, Error::InsufficientFunds as u8);
§

SourceNotFound = 1

Source purse not found.

assert_eq!(1, Error::SourceNotFound as u8);
§

DestNotFound = 2

Destination purse not found.

assert_eq!(2, Error::DestNotFound as u8);
§

InvalidURef = 3

The given URef does not reference the account holder’s purse, or such a URef does not have the required AccessRights.

assert_eq!(3, Error::InvalidURef as u8);
§

InvalidAccessRights = 4

The source purse is not writeable (see URef::is_writeable), or the destination purse is not addable (see URef::is_addable).

assert_eq!(4, Error::InvalidAccessRights as u8);
§

InvalidNonEmptyPurseCreation = 5

Tried to create a new purse with a non-zero initial balance.

assert_eq!(5, Error::InvalidNonEmptyPurseCreation as u8);
§

Storage = 6

Failed to read from local or global storage.

assert_eq!(6, Error::Storage as u8);
§

PurseNotFound = 7

Purse not found while trying to get balance.

assert_eq!(7, Error::PurseNotFound as u8);
§

MissingKey = 8

Unable to obtain a key by its name.

assert_eq!(8, Error::MissingKey as u8);
§

TotalSupplyNotFound = 9

Total supply not found.

assert_eq!(9, Error::TotalSupplyNotFound as u8);
§

RecordTransferFailure = 10

Failed to record transfer.

assert_eq!(10, Error::RecordTransferFailure as u8);
§

InvalidTotalSupplyReductionAttempt = 11

Invalid attempt to reduce total supply.

assert_eq!(11, Error::InvalidTotalSupplyReductionAttempt as u8);
§

NewURef = 12

Failed to create new uref.

assert_eq!(12, Error::NewURef as u8);
§

PutKey = 13

Failed to put key.

assert_eq!(13, Error::PutKey as u8);
§

WriteDictionary = 14

Failed to write to dictionary.

assert_eq!(14, Error::WriteDictionary as u8);
§

CLValue = 15

Failed to create a crate::CLValue.

assert_eq!(15, Error::CLValue as u8);
§

Serialize = 16

Failed to serialize data.

assert_eq!(16, Error::Serialize as u8);
§

EqualSourceAndTarget = 17

Source and target purse crate::URefs are equal.

assert_eq!(17, Error::EqualSourceAndTarget as u8);
§

ArithmeticOverflow = 18

An arithmetic overflow has occurred.

assert_eq!(18, Error::ArithmeticOverflow as u8);
§

InvalidContext = 20

Raised when an entry point is called from invalid account context.

§

UnapprovedSpendingAmount = 21

Session code tried to transfer more CSPR than user approved.

assert_eq!(21, Error::UnapprovedSpendingAmount as u8);
§

DisabledUnrestrictedTransfers = 22

Failed to transfer tokens on a private chain.

assert_eq!(22, Error::DisabledUnrestrictedTransfers as u8);

Trait Implementations§

source§

impl CLTyped for Error

source§

fn cl_type() -> CLType

The CLType of Self.
source§

impl Clone for Error

source§

fn clone(&self) -> Error

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 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, formatter: &mut Formatter<'_>) -> Result

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

impl From<Error> for ApiError

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(error: Error) -> Error

Converts to this type from the input type.
source§

impl FromBytes for Error

source§

fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>

Deserializes the slice into Self.
source§

fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error>

Deserializes the Vec<u8> into Self.
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 ToBytes for Error

source§

fn to_bytes(&self) -> Result<Vec<u8>, Error>

Serializes &self to a Vec<u8>.
source§

fn serialized_length(&self) -> usize

Returns the length of the Vec<u8> which would be returned from a successful call to to_bytes() or into_bytes(). The data is not actually serialized, so this call is relatively cheap.
source§

fn into_bytes(self) -> Result<Vec<u8>, Error>where Self: Sized,

Consumes self and serializes to a Vec<u8>.
source§

fn write_bytes(&self, writer: &mut Vec<u8>) -> Result<(), Error>

Writes &self into a mutable writer.
source§

impl Copy for Error

source§

impl Eq for Error

source§

impl StructuralEq for Error

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

§

type Output = T

Should always be Self
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.