Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions programs/stake/src/legacy_stake_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ impl<'a> StakeAccount for KeyedAccount<'a> {
StakeState::Stake(meta, stake) => {
// stake must be fully de-activated
if stake.stake(clock.epoch, Some(stake_history)) != 0 {
return Err(StakeError::MergeActivatedStake.into());
return Err(StakeError::MergeTransientStake.into());
}
meta
}
Expand All @@ -555,7 +555,7 @@ impl<'a> StakeAccount for KeyedAccount<'a> {
StakeState::Stake(meta, stake) => {
// stake must be fully de-activated
if stake.stake(clock.epoch, Some(stake_history)) != 0 {
return Err(StakeError::MergeActivatedStake.into());
return Err(StakeError::MergeTransientStake.into());
}
meta
}
Expand Down Expand Up @@ -3239,7 +3239,7 @@ mod tests {
&StakeHistory::default(),
&signers,
),
Err(StakeError::MergeActivatedStake.into())
Err(StakeError::MergeTransientStake.into())
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions programs/stake/src/stake_instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ pub enum StakeError {
#[error("split amount is more than is staked")]
InsufficientStake,

#[error("stake account with activated stake cannot be merged")]
MergeActivatedStake,
#[error("stake account with transient stake cannot be merged")]
MergeTransientStake,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More accurate error name/message


#[error("stake account merge failed due to different authority or lockups")]
#[error("stake account merge failed due to different authority, lockups or state")]
MergeMismatch,
}

Expand Down
Loading