#[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 Fail for Error
impl Fail for Error
Source§fn cause(&self) -> Option<&dyn Fail>
fn cause(&self) -> Option<&dyn Fail>
Source§fn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Backtrace
carried by this failure, if it
carries one. Read moreSource§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.