Skip to content

Commit a433bb3

Browse files
authored
Add ability to update entire vote state (solana-labs#20014)
1 parent 4dcf594 commit a433bb3

File tree

2 files changed

+825
-3
lines changed

2 files changed

+825
-3
lines changed

programs/vote/src/vote_instruction.rs

+31
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,37 @@ pub enum VoteError {
4646

4747
#[error("authorized voter has already been changed this epoch")]
4848
TooSoonToReauthorize,
49+
50+
// TODO: figure out how to migrate these new errors
51+
#[error("Old state had vote which should not have been popped off by vote in new state")]
52+
LockoutConflict,
53+
54+
#[error("Proposed state had earlier slot which should have been popped off by later vote")]
55+
NewVoteStateLockoutMismatch,
56+
57+
#[error("Vote slots are not ordered")]
58+
SlotsNotOrdered,
59+
60+
#[error("Confirmations are not ordered")]
61+
ConfirmationsNotOrdered,
62+
63+
#[error("Zero confirmations")]
64+
ZeroConfirmations,
65+
66+
#[error("Confirmation exceeds limit")]
67+
ConfirmationTooLarge,
68+
69+
#[error("Root rolled back")]
70+
RootRollBack,
71+
72+
#[error("Confirmations for same vote were smaller in new proposed state")]
73+
ConfirmationRollBack,
74+
75+
#[error("New state contained a vote slot smaller than the root")]
76+
SlotSmallerThanRoot,
77+
78+
#[error("New state contained too many votes")]
79+
TooManyVotes,
4980
}
5081

5182
impl<E> DecodeError<E> for VoteError {

0 commit comments

Comments
 (0)