Use TransactionBuilder in the Rewards transaction
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
use crate::account::{Account, KeyedAccount};
|
||||
use crate::native_program::ProgramError;
|
||||
use crate::pubkey::Pubkey;
|
||||
use crate::transaction_builder::BuilderInstruction;
|
||||
use bincode::{deserialize, serialize_into, serialized_size, ErrorKind};
|
||||
use log::*;
|
||||
use std::collections::VecDeque;
|
||||
@ -78,6 +79,12 @@ pub enum VoteInstruction {
|
||||
ClearCredits,
|
||||
}
|
||||
|
||||
impl VoteInstruction {
|
||||
pub fn new_clear_credits(vote_id: Pubkey) -> BuilderInstruction {
|
||||
BuilderInstruction::new(id(), &VoteInstruction::ClearCredits, vec![(vote_id, true)])
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub struct VoteState {
|
||||
pub votes: VecDeque<Lockout>,
|
||||
|
Reference in New Issue
Block a user