Enum solana_sdk::vote::instruction::VoteInstruction
source · pub enum VoteInstruction {
Show 14 variants
InitializeAccount(VoteInit),
Authorize(Pubkey, VoteAuthorize),
Vote(Vote),
Withdraw(u64),
UpdateValidatorIdentity,
UpdateCommission(u8),
VoteSwitch(Vote, Hash),
AuthorizeChecked(VoteAuthorize),
UpdateVoteState(VoteStateUpdate),
UpdateVoteStateSwitch(VoteStateUpdate, Hash),
AuthorizeWithSeed(VoteAuthorizeWithSeedArgs),
AuthorizeCheckedWithSeed(VoteAuthorizeCheckedWithSeedArgs),
CompactUpdateVoteState(VoteStateUpdate),
CompactUpdateVoteStateSwitch(VoteStateUpdate, Hash),
}
Variants§
InitializeAccount(VoteInit)
Initialize a vote account
Account references
[WRITE]
Uninitialized vote account[]
Rent sysvar[]
Clock sysvar[SIGNER]
New validator identity (node_pubkey)
Authorize(Pubkey, VoteAuthorize)
Authorize a key to send votes or issue a withdrawal
Account references
[WRITE]
Vote account to be updated with the Pubkey for authorization[]
Clock sysvar[SIGNER]
Vote or withdraw authority
Vote(Vote)
A Vote instruction with recent votes
Account references
[WRITE]
Vote account to vote with[]
Slot hashes sysvar[]
Clock sysvar[SIGNER]
Vote authority
Withdraw(u64)
Withdraw some amount of funds
Account references
[WRITE]
Vote account to withdraw from[WRITE]
Recipient account[SIGNER]
Withdraw authority
UpdateValidatorIdentity
Update the vote account’s validator identity (node_pubkey)
Account references
[WRITE]
Vote account to be updated with the given authority public key[SIGNER]
New validator identity (node_pubkey)[SIGNER]
Withdraw authority
UpdateCommission(u8)
Update the commission for the vote account
Account references
[WRITE]
Vote account to be updated[SIGNER]
Withdraw authority
VoteSwitch(Vote, Hash)
A Vote instruction with recent votes
Account references
[WRITE]
Vote account to vote with[]
Slot hashes sysvar[]
Clock sysvar[SIGNER]
Vote authority
AuthorizeChecked(VoteAuthorize)
Authorize a key to send votes or issue a withdrawal
This instruction behaves like Authorize
with the additional requirement that the new vote
or withdraw authority must also be a signer.
Account references
[WRITE]
Vote account to be updated with the Pubkey for authorization[]
Clock sysvar[SIGNER]
Vote or withdraw authority[SIGNER]
New vote or withdraw authority
UpdateVoteState(VoteStateUpdate)
Update the onchain vote state for the signer.
Account references
[Write]
Vote account to vote with[SIGNER]
Vote authority
UpdateVoteStateSwitch(VoteStateUpdate, Hash)
Update the onchain vote state for the signer along with a switching proof.
Account references
[Write]
Vote account to vote with[SIGNER]
Vote authority
AuthorizeWithSeed(VoteAuthorizeWithSeedArgs)
Given that the current Voter or Withdrawer authority is a derived key, this instruction allows someone who can sign for that derived key’s base key to authorize a new Voter or Withdrawer for a vote account.
Account references
[Write]
Vote account to be updated[]
Clock sysvar[SIGNER]
Base key of current Voter or Withdrawer authority’s derived key
AuthorizeCheckedWithSeed(VoteAuthorizeCheckedWithSeedArgs)
Given that the current Voter or Withdrawer authority is a derived key, this instruction allows someone who can sign for that derived key’s base key to authorize a new Voter or Withdrawer for a vote account.
This instruction behaves like AuthorizeWithSeed
with the additional requirement
that the new vote or withdraw authority must also be a signer.
Account references
[Write]
Vote account to be updated[]
Clock sysvar[SIGNER]
Base key of current Voter or Withdrawer authority’s derived key[SIGNER]
New vote or withdraw authority
CompactUpdateVoteState(VoteStateUpdate)
Update the onchain vote state for the signer.
Account references
[Write]
Vote account to vote with[SIGNER]
Vote authority
CompactUpdateVoteStateSwitch(VoteStateUpdate, Hash)
Update the onchain vote state for the signer along with a switching proof.
Account references
[Write]
Vote account to vote with[SIGNER]
Vote authority
Implementations§
source§impl VoteInstruction
impl VoteInstruction
pub fn is_simple_vote(&self) -> bool
pub fn is_single_vote_state_update(&self) -> bool
sourcepub fn last_voted_slot(&self) -> Option<u64>
pub fn last_voted_slot(&self) -> Option<u64>
Only to be used on vote instructions (guard with is_simple_vote), panics otherwise
Trait Implementations§
source§impl Clone for VoteInstruction
impl Clone for VoteInstruction
source§fn clone(&self) -> VoteInstruction
fn clone(&self) -> VoteInstruction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for VoteInstruction
impl Debug for VoteInstruction
source§impl<'de> Deserialize<'de> for VoteInstruction
impl<'de> Deserialize<'de> for VoteInstruction
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<VoteInstruction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<VoteInstruction, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl PartialEq<VoteInstruction> for VoteInstruction
impl PartialEq<VoteInstruction> for VoteInstruction
source§fn eq(&self, other: &VoteInstruction) -> bool
fn eq(&self, other: &VoteInstruction) -> bool
self
and other
values to be equal, and is used
by ==
.