Enum casper_types::system::handle_payment::Error
source ·
[−]#[repr(u8)]
pub enum Error {
Show 33 variants
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,
GetBalance,
PutKey,
RemoveKey,
Transfer,
ArithmeticOverflow,
RefundPurseIsPaymentPurse,
// some variants omitted
}
Expand description
Errors which can occur while executing the Handle Payment contract.
Variants
NotBonded
The given validator is not bonded.
assert_eq!(0, Error::NotBonded as u8);
TooManyEventsInQueue
There are too many bonding or unbonding attempts already enqueued to allow more.
assert_eq!(1, Error::TooManyEventsInQueue as u8);
CannotUnbondLastValidator
At least one validator must remain bonded.
assert_eq!(2, Error::CannotUnbondLastValidator as u8);
SpreadTooHigh
Failed to bond or unbond as this would have resulted in exceeding the maximum allowed difference between the largest and smallest stakes.
assert_eq!(3, Error::SpreadTooHigh as u8);
MultipleRequests
The given validator already has a bond or unbond attempt enqueued.
assert_eq!(4, Error::MultipleRequests as u8);
BondTooSmall
Attempted to bond with a stake which was too small.
assert_eq!(5, Error::BondTooSmall as u8);
BondTooLarge
Attempted to bond with a stake which was too large.
assert_eq!(6, Error::BondTooLarge as u8);
UnbondTooLarge
Attempted to unbond an amount which was too large.
assert_eq!(7, Error::UnbondTooLarge as u8);
BondTransferFailed
While bonding, the transfer from source purse to the Handle Payment internal purse failed.
assert_eq!(8, Error::BondTransferFailed as u8);
UnbondTransferFailed
While unbonding, the transfer from the Handle Payment internal purse to the destination purse failed.
assert_eq!(9, Error::UnbondTransferFailed as u8);
TimeWentBackwards
Internal error: a BlockTime
was unexpectedly out of sequence.
assert_eq!(10, Error::TimeWentBackwards as u8);
StakesNotFound
Internal error: stakes were unexpectedly empty.
assert_eq!(11, Error::StakesNotFound as u8);
PaymentPurseNotFound
Internal error: the Handle Payment contract’s payment purse wasn’t found.
assert_eq!(12, Error::PaymentPurseNotFound as u8);
PaymentPurseKeyUnexpectedType
Internal error: the Handle Payment contract’s payment purse key was the wrong type.
assert_eq!(13, Error::PaymentPurseKeyUnexpectedType as u8);
PaymentPurseBalanceNotFound
Internal error: couldn’t retrieve the balance for the Handle Payment contract’s payment purse.
assert_eq!(14, Error::PaymentPurseBalanceNotFound as u8);
BondingPurseNotFound
Internal error: the Handle Payment contract’s bonding purse wasn’t found.
assert_eq!(15, Error::BondingPurseNotFound as u8);
BondingPurseKeyUnexpectedType
Internal error: the Handle Payment contract’s bonding purse key was the wrong type.
assert_eq!(16, Error::BondingPurseKeyUnexpectedType as u8);
RefundPurseKeyUnexpectedType
Internal error: the Handle Payment contract’s refund purse key was the wrong type.
assert_eq!(17, Error::RefundPurseKeyUnexpectedType as u8);
RewardsPurseNotFound
Internal error: the Handle Payment contract’s rewards purse wasn’t found.
assert_eq!(18, Error::RewardsPurseNotFound as u8);
RewardsPurseKeyUnexpectedType
Internal error: the Handle Payment contract’s rewards purse key was the wrong type.
assert_eq!(19, Error::RewardsPurseKeyUnexpectedType as u8);
StakesKeyDeserializationFailed
Internal error: failed to deserialize the stake’s key.
assert_eq!(20, Error::StakesKeyDeserializationFailed as u8);
StakesDeserializationFailed
Internal error: failed to deserialize the stake’s balance.
assert_eq!(21, Error::StakesDeserializationFailed as u8);
SystemFunctionCalledByUserAccount
The invoked Handle Payment function can only be called by system contracts, but was called by a user contract.
assert_eq!(22, Error::SystemFunctionCalledByUserAccount as u8);
InsufficientPaymentForAmountSpent
Internal error: while finalizing payment, the amount spent exceeded the amount available.
assert_eq!(23, Error::InsufficientPaymentForAmountSpent as u8);
FailedTransferToRewardsPurse
Internal error: while finalizing payment, failed to pay the validators (the transfer from the Handle Payment contract’s payment purse to rewards purse failed).
assert_eq!(24, Error::FailedTransferToRewardsPurse as u8);
FailedTransferToAccountPurse
Internal error: while finalizing payment, failed to refund the caller’s purse (the transfer from the Handle Payment contract’s payment purse to refund purse or account’s main purse failed).
assert_eq!(25, Error::FailedTransferToAccountPurse as u8);
SetRefundPurseCalledOutsidePayment
Handle Payment contract’s “set_refund_purse” method can only be called by the payment code of a deploy, but was called by the session code.
assert_eq!(26, Error::SetRefundPurseCalledOutsidePayment as u8);
GetBalance
Raised when the system is unable to determine purse balance.
assert_eq!(27, Error::GetBalance as u8);
PutKey
Raised when the system is unable to put named key.
assert_eq!(28, Error::PutKey as u8);
RemoveKey
Raised when the system is unable to remove given named key.
assert_eq!(29, Error::RemoveKey as u8);
Transfer
Failed to transfer funds.
assert_eq!(30, Error::Transfer as u8);
ArithmeticOverflow
An arithmetic overflow occurred
assert_eq!(31, Error::ArithmeticOverflow as u8);
RefundPurseIsPaymentPurse
Refund purse is a payment purse.
Trait Implementations
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. Read more
Auto Trait Implementations
impl RefUnwindSafe for Error
impl UnwindSafe for Error
Blanket Implementations
Mutably borrows from an owned value. Read more
Causes self
to use its Binary
implementation when Debug
-formatted.
Causes self
to use its Display
implementation when
Debug
-formatted. Read more
Causes self
to use its LowerExp
implementation when
Debug
-formatted. Read more
Causes self
to use its LowerHex
implementation when
Debug
-formatted. Read more
Causes self
to use its Octal
implementation when Debug
-formatted.
Causes self
to use its Pointer
implementation when
Debug
-formatted. Read more
Causes self
to use its UpperExp
implementation when
Debug
-formatted. Read more
Causes self
to use its UpperHex
implementation when
Debug
-formatted. Read more
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a dereference into a function that cannot normally be called in suffix position. Read more
Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more
Provides immutable access to the reference for inspection.
Calls tap_ref
in debug builds, and does nothing in release builds.
Provides mutable access to the reference for modification.
Calls tap_ref_mut
in debug builds, and does nothing in release builds.
Provides immutable access to the borrow for inspection. Read more
Calls tap_borrow
in debug builds, and does nothing in release builds.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
Immutably dereferences self
for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref
in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self
for modification.