#[repr(u8)]
pub enum Error {
Show 27 variants NotBonded = 0, TooManyEventsInQueue = 1, CannotUnbondLastValidator = 2, SpreadTooHigh = 3, MultipleRequests = 4, BondTooSmall = 5, BondTooLarge = 6, UnbondTooLarge = 7, BondTransferFailed = 8, UnbondTransferFailed = 9, TimeWentBackwards = 10, StakesNotFound = 11, PaymentPurseNotFound = 12, PaymentPurseKeyUnexpectedType = 13, PaymentPurseBalanceNotFound = 14, BondingPurseNotFound = 15, BondingPurseKeyUnexpectedType = 16, RefundPurseKeyUnexpectedType = 17, RewardsPurseNotFound = 18, RewardsPurseKeyUnexpectedType = 19, StakesKeyDeserializationFailed = 20, StakesDeserializationFailed = 21, SystemFunctionCalledByUserAccount = 22, InsufficientPaymentForAmountSpent = 23, FailedTransferToRewardsPurse = 24, FailedTransferToAccountPurse = 25, SetRefundPurseCalledOutsidePayment = 26,
}
Expand description

Errors which can occur while executing the Proof of Stake contract.

Variants§

§

NotBonded = 0

The given validator is not bonded.

§

TooManyEventsInQueue = 1

There are too many bonding or unbonding attempts already enqueued to allow more.

§

CannotUnbondLastValidator = 2

At least one validator must remain bonded.

§

SpreadTooHigh = 3

Failed to bond or unbond as this would have resulted in exceeding the maximum allowed difference between the largest and smallest stakes.

§

MultipleRequests = 4

The given validator already has a bond or unbond attempt enqueued.

§

BondTooSmall = 5

Attempted to bond with a stake which was too small.

§

BondTooLarge = 6

Attempted to bond with a stake which was too large.

§

UnbondTooLarge = 7

Attempted to unbond an amount which was too large.

§

BondTransferFailed = 8

While bonding, the transfer from source purse to the Proof of Stake internal purse failed.

§

UnbondTransferFailed = 9

While unbonding, the transfer from the Proof of Stake internal purse to the destination purse failed.

§

TimeWentBackwards = 10

Internal error: a BlockTime was unexpectedly out of sequence.

§

StakesNotFound = 11

Internal error: stakes were unexpectedly empty.

§

PaymentPurseNotFound = 12

Internal error: the PoS contract’s payment purse wasn’t found.

§

PaymentPurseKeyUnexpectedType = 13

Internal error: the PoS contract’s payment purse key was the wrong type.

§

PaymentPurseBalanceNotFound = 14

Internal error: couldn’t retrieve the balance for the PoS contract’s payment purse.

§

BondingPurseNotFound = 15

Internal error: the PoS contract’s bonding purse wasn’t found.

§

BondingPurseKeyUnexpectedType = 16

Internal error: the PoS contract’s bonding purse key was the wrong type.

§

RefundPurseKeyUnexpectedType = 17

Internal error: the PoS contract’s refund purse key was the wrong type.

§

RewardsPurseNotFound = 18

Internal error: the PoS contract’s rewards purse wasn’t found.

§

RewardsPurseKeyUnexpectedType = 19

Internal error: the PoS contract’s rewards purse key was the wrong type.

§

StakesKeyDeserializationFailed = 20

Internal error: failed to deserialize the stake’s key.

§

StakesDeserializationFailed = 21

Internal error: failed to deserialize the stake’s balance.

§

SystemFunctionCalledByUserAccount = 22

The invoked PoS function can only be called by system contracts, but was called by a user contract.

§

InsufficientPaymentForAmountSpent = 23

Internal error: while finalizing payment, the amount spent exceeded the amount available.

§

FailedTransferToRewardsPurse = 24

Internal error: while finalizing payment, failed to pay the validators (the transfer from the PoS contract’s payment purse to rewards purse failed).

§

FailedTransferToAccountPurse = 25

Internal error: while finalizing payment, failed to refund the caller’s purse (the transfer from the PoS contract’s payment purse to refund purse or account’s main purse failed).

§

SetRefundPurseCalledOutsidePayment = 26

PoS contract’s “set_refund_purse” method can only be called by the payment code of a deploy, but was called by the session code.

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

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

impl Fail for Error

Source§

fn name(&self) -> Option<&str>

Returns the “name” of the error. Read more
Source§

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

Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more
Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a reference to the Backtrace carried by this failure, if it carries one. Read more
Source§

fn context<D>(self, context: D) -> Context<D>
where D: Display + Send + Sync + 'static, Self: Sized,

Provides context for this failure. Read more
Source§

fn compat(self) -> Compat<Self>
where Self: Sized,

Wraps this failure in a compatibility wrapper that implements std::error::Error. 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 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§

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> AsFail for T
where T: Fail,

Source§

fn as_fail(&self) -> &(dyn Fail + 'static)

Converts a reference to Self into a dynamic trait object of Fail.
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> 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> 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.