vote: Add helper for creating current-versioned states
This commit is contained in:
committed by
Trent Nelson
parent
3881ae10fb
commit
5b903318b2
@@ -10829,7 +10829,7 @@ pub(crate) mod tests {
|
||||
let mut vote_account = bank.get_account(vote_pubkey).unwrap_or_default();
|
||||
let mut vote_state = VoteState::from(&vote_account).unwrap_or_default();
|
||||
vote_state.last_timestamp = timestamp;
|
||||
let versioned = VoteStateVersions::Current(Box::new(vote_state));
|
||||
let versioned = VoteStateVersions::new_current(vote_state);
|
||||
VoteState::to(&versioned, &mut vote_account).unwrap();
|
||||
bank.store_account(vote_pubkey, &vote_account);
|
||||
}
|
||||
|
@@ -316,7 +316,7 @@ mod tests {
|
||||
let vote_state = VoteState::new(&vote_init, &clock);
|
||||
let account = Account::new_data(
|
||||
rng.gen(), // lamports
|
||||
&VoteStateVersions::Current(Box::new(vote_state.clone())),
|
||||
&VoteStateVersions::new_current(vote_state.clone()),
|
||||
&Pubkey::new_unique(), // owner
|
||||
)
|
||||
.unwrap();
|
||||
|
Reference in New Issue
Block a user