Add vote instructions that directly update on chain vote state (#21531)
* Add vote state instructions UpdateVoteState and UpdateVoteStateSwitch * cargo tree * extract vote state version conversion to common fn
This commit is contained in:
@ -6146,7 +6146,10 @@ pub fn is_simple_vote_transaction(transaction: &SanitizedTransaction) -> bool {
|
||||
{
|
||||
return matches!(
|
||||
vote_instruction,
|
||||
VoteInstruction::Vote(_) | VoteInstruction::VoteSwitch(_, _)
|
||||
VoteInstruction::Vote(_)
|
||||
| VoteInstruction::VoteSwitch(_, _)
|
||||
| VoteInstruction::UpdateVoteState(_)
|
||||
| VoteInstruction::UpdateVoteStateSwitch(_, _)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ pub fn find_and_send_votes(
|
||||
if let Some(parsed_vote) =
|
||||
vote_transaction::parse_sanitized_vote_transaction(tx)
|
||||
{
|
||||
if parsed_vote.1.slots.last().is_some() {
|
||||
if parsed_vote.1.last_voted_slot().is_some() {
|
||||
let _ = vote_sender.send(parsed_vote);
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
use {
|
||||
crossbeam_channel::{Receiver, Sender},
|
||||
solana_sdk::{hash::Hash, pubkey::Pubkey},
|
||||
solana_vote_program::vote_state::Vote,
|
||||
solana_vote_program::vote_transaction::ParsedVote,
|
||||
};
|
||||
|
||||
pub type ReplayedVote = (Pubkey, Vote, Option<Hash>);
|
||||
pub type ReplayVoteSender = Sender<ReplayedVote>;
|
||||
pub type ReplayVoteReceiver = Receiver<ReplayedVote>;
|
||||
pub type ReplayVoteSender = Sender<ParsedVote>;
|
||||
pub type ReplayVoteReceiver = Receiver<ParsedVote>;
|
||||
|
Reference in New Issue
Block a user