pub fn increment_vote_account_credits(
        &mut self,
        vote_account_address: &Pubkey,
        number_of_credits: u64,
    ) {
        let bank_forks = self.bank_forks.read().unwrap();
        let bank = bank_forks.working_bank();

        // generate some vote activity for rewards
        let mut vote_account = bank.get_account(vote_account_address).unwrap();
        let mut vote_state = VoteState::from(&vote_account).unwrap();

        let epoch = bank.epoch();
        for _ in 0..number_of_credits {
            vote_state.increment_credits(epoch);
        }
        let versioned = VoteStateVersions::new_current(vote_state);
        VoteState::to(&versioned, &mut vote_account).unwrap();
        bank.store_account(vote_account_address, &vote_account);
    }
/// Manually increment vote credits for the current epoch in the specified vote account to simulate validator voting activity
Manually increment vote credits for the current epoch in the specified vote account to simulate validator voting activity
Manually increment vote credits for the current epoch in the specified vote account to simulate validator voting activity
pub fn increment_vote_account_credits(
        &mut self,
        vote_account_address: &Pubkey,
        number_of_credits: u64,
    ) {
        let bank_forks = self.bank_forks.read().unwrap();
        let bank = bank_forks.working_bank();
        // generate some vote activity for rewards
        let mut vote_account = bank.get_account(vote_account_address).unwrap();
        let mut vote_state = VoteState::from(&vote_account).unwrap();
        let epoch = bank.epoch();
        for _ in 0..number_of_credits {
            vote_state.increment_credits(epoch);
        }
        let versioned = VoteStateVersions::new_current(vote_state);
        VoteState::to(&versioned, &mut vote_account).unwrap();
        bank.store_account(vote_account_address, &vote_account);
    }
pub fn increment_vote_account_credits ( & mut self , vote_account_address : & Pubkey , number_of_credits : u64 , ) { let bank_forks = self . bank_forks . read ( ) . unwrap ( ) ; let bank = bank_forks . working_bank ( ) ; // generate some vote activity for rewards let mut vote_account = bank . get_account ( vote_account_address ) . unwrap ( ) ; let mut vote_state = VoteState :: from ( & vote_account ) . unwrap ( ) ; let epoch = bank . epoch ( ) ; for _ in 0 .. number_of_credits { vote_state . increment_credits ( epoch ) ; } let versioned = VoteStateVersions :: new_current ( vote_state ) ; VoteState :: to ( & versioned , & mut vote_account ) . unwrap ( ) ; bank . store_account ( vote_account_address , & vote_account ) ; }
Manually increment vote credits for the current epoch in the specified vote account to simulate validator voting activity
Manually increment vote credits for the current epoch in the specified vote account to simulate validator voting activity
&mut self
vote_account_address
&Pubkey
number_of_credits
u64