#[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
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::URef
s 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 ToBytes for Error
impl ToBytes for Error
Source§fn serialized_length(&self) -> usize
fn serialized_length(&self) -> usize
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.impl Copy for Error
impl Eq for Error
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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