Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
minor VoteAccount refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington committed Mar 15, 2022
1 parent 62b26f0 commit cf10f4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runtime/src/vote_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use {
ser::{Serialize, Serializer},
},
solana_sdk::{
account::{Account, AccountSharedData},
account::{Account, AccountSharedData, ReadableAccount},
instruction::InstructionError,
pubkey::Pubkey,
},
Expand Down Expand Up @@ -57,7 +57,7 @@ impl VoteAccount {
}

pub(crate) fn lamports(&self) -> u64 {
self.account().lamports
self.account().lamports()
}

pub fn vote_state(&self) -> RwLockReadGuard<Result<VoteState, InstructionError>> {
Expand Down Expand Up @@ -405,7 +405,7 @@ mod tests {
fn test_vote_account() {
let mut rng = rand::thread_rng();
let (account, vote_state) = new_rand_vote_account(&mut rng, None);
let lamports = account.lamports;
let lamports = account.lamports();
let vote_account = VoteAccount::from(account);
assert_eq!(lamports, vote_account.lamports());
assert_eq!(vote_state, *vote_account.vote_state().as_ref().unwrap());
Expand Down

0 comments on commit cf10f4a

Please sign in to comment.