Enum casper_types::system::handle_payment::Error[][src]

#[repr(u8)]
pub enum Error {
Show 32 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, // some variants omitted
}
Expand description

Errors which can occur while executing the Handle Payment 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 Handle Payment internal purse failed.

UnbondTransferFailed

While unbonding, the transfer from the Handle Payment 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 Handle Payment contract’s payment purse wasn’t found.

PaymentPurseKeyUnexpectedType

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

PaymentPurseBalanceNotFound

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

BondingPurseNotFound

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

BondingPurseKeyUnexpectedType

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

RefundPurseKeyUnexpectedType

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

RewardsPurseNotFound

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

RewardsPurseKeyUnexpectedType

Internal error: the Handle Payment 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 Handle Payment 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 Handle Payment 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 Handle Payment contract’s payment purse to refund purse or account’s main purse failed).

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.

GetBalance

Raised when the system is unable to determine purse balance.

PutKey

Raised when the system is unable to put named key.

RemoveKey

Raised when the system is unable to remove given named key.

Transfer

Failed to transfer funds.

ArithmeticOverflow

An arithmetic overflow occurred

Trait Implementations

The CLType of Self.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serializes &self to a Vec<u8>.

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

Consumes self and serializes to a Vec<u8>.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into a target type. 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

Performs the conversion.

Performs the conversion.

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable 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

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Should always be Self

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

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.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into a target type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.