Reject close of active vote accounts (#22651)

* 10461 Reject close of vote accounts unless it earned no credits in the previous epoch. This is checked by comparing current epoch (from clock sysvar) with the most recent epoch with credits in vote state.
This commit is contained in:
Will Hickey
2022-02-02 14:16:24 -06:00
committed by GitHub
parent 58a70d76a3
commit 75563f6c7b
8 changed files with 385 additions and 17 deletions

View File

@ -252,6 +252,10 @@ pub enum InstructionError {
/// Accounts data budget exceeded
#[error("Requested account data allocation exceeded the accounts data budget")]
AccountsDataBudgetExceeded,
/// Active vote account close
#[error("Cannot close vote account unless it stopped voting at least one full epoch ago")]
ActiveVoteAccountClose,
// Note: For any new error added here an equivalent ProgramError and its
// conversions must also be added
}