[][src]Enum casperlabs_types::system_contract_errors::pos::Error

#[repr(u8)]pub enum Error {
    NotBonded,
    TooManyEventsInQueue,
    CannotUnbondLastValidator,
    SpreadTooHigh,
    MultipleRequests,
    BondTooSmall,
    BondTooLarge,
    UnbondTooLarge,
    BondTransferFailed,
    UnbondTransferFailed,
    TimeWentBackwards,
    StakesNotFound,
    PaymentPurseNotFound,
    PaymentPurseKeyUnexpectedType,
    PaymentPurseBalanceNotFound,
    BondingPurseNotFound,
    BondingPurseKeyUnexpectedType,
    RefundPurseKeyUnexpectedType,
    RewardsPurseNotFound,
    RewardsPurseKeyUnexpectedType,
    StakesKeyDeserializationFailed,
    StakesDeserializationFailed,
    SystemFunctionCalledByUserAccount,
    InsufficientPaymentForAmountSpent,
    FailedTransferToRewardsPurse,
    FailedTransferToAccountPurse,
    SetRefundPurseCalledOutsidePayment,
}

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

Variants

NotBonded

The given validator is not bonded.

TooManyEventsInQueue

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

CannotUnbondLastValidator

At least one validator must remain bonded.

SpreadTooHigh

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

MultipleRequests

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

BondTooSmall

Attempted to bond with a stake which was too small.

BondTooLarge

Attempted to bond with a stake which was too large.

UnbondTooLarge

Attempted to unbond an amount which was too large.

BondTransferFailed

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

UnbondTransferFailed

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

TimeWentBackwards

Internal error: a BlockTime was unexpectedly out of sequence.

StakesNotFound

Internal error: stakes were unexpectedly empty.

PaymentPurseNotFound

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

PaymentPurseKeyUnexpectedType

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

PaymentPurseBalanceNotFound

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

BondingPurseNotFound

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

BondingPurseKeyUnexpectedType

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

RefundPurseKeyUnexpectedType

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

RewardsPurseNotFound

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

RewardsPurseKeyUnexpectedType

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

StakesKeyDeserializationFailed

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

StakesDeserializationFailed

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

SystemFunctionCalledByUserAccount

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

InsufficientPaymentForAmountSpent

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

FailedTransferToRewardsPurse

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

FailedTransferToAccountPurse

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

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

impl CLTyped for Error[src]

impl Clone for Error[src]

impl Copy for Error[src]

impl Debug for Error[src]

impl Display for Error[src]

impl Eq for Error[src]

impl Fail for Error[src]

impl From<Error> for ApiError[src]

impl From<Error> for Error[src]

impl PartialEq<Error> for Error[src]

impl StructuralEq for Error[src]

impl StructuralPartialEq for Error[src]

impl ToBytes for Error[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsFail for T where
    T: Fail
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.