Enum Error

Source
#[non_exhaustive]
#[repr(u8)]
pub enum Error {
Show 25 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, ForgedReference = 23, InconsistentBalances = 24, UnableToGetSystemRegistry = 25,
}
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);
§

ForgedReference = 23

Attempt to access a record using forged permissions.

assert_eq!(23, Error::ForgedReference as u8);
§

InconsistentBalances = 24

Available balance can never be greater than total balance.

assert_eq!(24, Error::InconsistentBalances as u8);
§

UnableToGetSystemRegistry = 25

Unable to get the system registry.

assert_eq!(25, Error::UnableToGetSystemRegistry 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 duplicate 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

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 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 StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where T: Display + ?Sized,

Source§

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

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more