Skip to content

Commit 44f10ea

Browse files
committed
may as well use v4 everywhere now
1 parent 70d5c32 commit 44f10ea

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

clients/cli/src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use {
1717
solana_signer::Signer,
1818
solana_stake_interface as stake,
1919
solana_transaction::Transaction,
20-
solana_vote_program::{self as vote_program, vote_state::VoteStateV3},
20+
solana_vote_program::{self as vote_program, vote_state::VoteStateV4},
2121
spl_associated_token_account_interface::instruction::create_associated_token_account,
2222
spl_single_pool::{
2323
self, find_pool_address, find_pool_mint_address, find_pool_onramp_address,
@@ -118,7 +118,7 @@ async fn command_initialize(config: &Config, command_config: InitializeCli) -> C
118118
match get_initialized_account(config, vote_account_address).await? {
119119
Some(vote_account)
120120
if vote_account.owner == vote_program::id()
121-
&& VoteStateV3::deserialize(&vote_account.data).is_ok() => {}
121+
&& VoteStateV4::deserialize(&vote_account.data, &vote_account_address).is_ok() => {}
122122
_ => return Err(format!("{} is not a valid vote account", vote_account_address).into()),
123123
}
124124

@@ -646,7 +646,8 @@ async fn command_update_metadata(
646646
.get_account(vote_account_address)
647647
.await?
648648
{
649-
let vote_account = VoteStateV3::deserialize(&vote_account_data.data)?;
649+
let vote_account =
650+
VoteStateV4::deserialize(&vote_account_data.data, &vote_account_address)?;
650651

651652
if authorized_withdrawer.pubkey() != vote_account.authorized_withdrawer {
652653
return Err(format!(

clients/cli/tests/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use {
2121
solana_transaction::Transaction,
2222
solana_vote_program::{
2323
vote_instruction::{self, CreateVoteAccountConfig},
24-
vote_state::{VoteInit, VoteStateV3},
24+
vote_state::{VoteInit, VoteStateV4},
2525
},
2626
spl_single_pool::{
2727
id,
@@ -152,7 +152,7 @@ async fn create_vote_account(
152152
.unwrap();
153153

154154
let vote_rent = rpc_client
155-
.get_minimum_balance_for_rent_exemption(VoteStateV3::size_of() * 2)
155+
.get_minimum_balance_for_rent_exemption(VoteStateV4::size_of() * 2)
156156
.await
157157
.unwrap();
158158

@@ -176,7 +176,7 @@ async fn create_vote_account(
176176
},
177177
vote_rent,
178178
CreateVoteAccountConfig {
179-
space: VoteStateV3::size_of() as u64,
179+
space: VoteStateV4::size_of() as u64,
180180
..Default::default()
181181
},
182182
));

program/tests/helpers/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use {
1919
solana_system_interface::{instruction as system_instruction, program as system_program},
2020
solana_vote_interface::{
2121
instruction as vote_instruction,
22-
state::{VoteInit, VoteStateV3},
22+
state::{VoteInit, VoteStateV4},
2323
},
2424
spl_associated_token_account_interface::address::get_associated_token_address,
2525
spl_single_pool::{
@@ -367,7 +367,7 @@ pub async fn create_vote(
367367
vote_account: &Keypair,
368368
) {
369369
let rent = banks_client.get_rent().await.unwrap();
370-
let rent_voter = rent.minimum_balance(VoteStateV3::size_of());
370+
let rent_voter = rent.minimum_balance(VoteStateV4::size_of());
371371

372372
let mut instructions = vec![system_instruction::create_account(
373373
&payer.pubkey(),
@@ -387,7 +387,7 @@ pub async fn create_vote(
387387
},
388388
rent_voter,
389389
vote_instruction::CreateVoteAccountConfig {
390-
space: VoteStateV3::size_of() as u64,
390+
space: VoteStateV4::size_of() as u64,
391391
..Default::default()
392392
},
393393
));

0 commit comments

Comments
 (0)