Fix active vote account close error (#26250)
This commit is contained in:
parent
50631e274d
commit
fa77cc5e48
|
@ -64,6 +64,9 @@ pub enum VoteError {
|
|||
|
||||
#[error("Proposed root is not in slot hashes")]
|
||||
RootOnDifferentFork,
|
||||
|
||||
#[error("Cannot close vote account unless it stopped voting at least one full epoch ago")]
|
||||
ActiveVoteAccountClose,
|
||||
}
|
||||
|
||||
impl<E> DecodeError<E> for VoteError {
|
||||
|
|
|
@ -1178,7 +1178,7 @@ mod tests {
|
|||
&serialize(&VoteInstruction::Withdraw(lamports)).unwrap(),
|
||||
transaction_accounts.clone(),
|
||||
instruction_accounts.clone(),
|
||||
Err(InstructionError::ActiveVoteAccountClose),
|
||||
Err(VoteError::ActiveVoteAccountClose.into()),
|
||||
);
|
||||
|
||||
// Both features disabled:
|
||||
|
|
|
@ -1336,7 +1336,7 @@ pub fn withdraw<S: std::hash::BuildHasher>(
|
|||
|
||||
if reject_active_vote_account_close {
|
||||
datapoint_debug!("vote-account-close", ("reject-active", 1, i64));
|
||||
return Err(InstructionError::ActiveVoteAccountClose);
|
||||
return Err(VoteError::ActiveVoteAccountClose.into());
|
||||
} else {
|
||||
// Deinitialize upon zero-balance
|
||||
datapoint_debug!("vote-account-close", ("allow", 1, i64));
|
||||
|
|
Loading…
Reference in New Issue