Skip to content

Commit

Permalink
Add StakeError index comments (anza-xyz#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
CriesofCarrots authored Apr 24, 2024
1 parent 550f806 commit 4672efa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/program/src/stake/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use {
/// Reasons the stake might have had an error
#[derive(Error, Debug, Clone, PartialEq, Eq, FromPrimitive, ToPrimitive)]
pub enum StakeError {
// 0
#[error("not enough credits to redeem")]
NoCreditsToRedeem,

Expand All @@ -36,6 +37,7 @@ pub enum StakeError {
#[error("split amount is more than is staked")]
InsufficientStake,

// 5
#[error("stake account with transient stake cannot be merged")]
MergeTransientStake,

Expand All @@ -51,6 +53,7 @@ pub enum StakeError {
#[error("insufficient voting activity in the reference vote account")]
InsufficientReferenceVotes,

// 10
#[error("stake account is not delegated to the provided vote account")]
VoteAddressMismatch,

Expand All @@ -68,6 +71,7 @@ pub enum StakeError {
#[error("stake redelegation to the same vote account is not permitted")]
RedelegateToSameVoteAccount,

// 15
#[error("redelegated stake must be fully activated before deactivation")]
RedelegatedStakeMustFullyActivateBeforeDeactivationIsPermitted,

Expand Down

0 comments on commit 4672efa

Please sign in to comment.