renames solana_runtime::vote_account::VoteAccount and makes it private (backport #19153) (#22141)

* makes solana_runtime::vote_account::VoteAccount private

VoteAccount is an implementation detail, and should not be public.
Only ArcVoteAccount is the public type.

(cherry picked from commit 1403eaeefc)

# Conflicts:
#	runtime/src/vote_account.rs

* renames solana_runtime::vote_account::VoteAccount

Rename:
  VoteAccount    -> VoteAccountInner  # the private type
  ArcVoteAccount -> VoteAccount       # the public type
(cherry picked from commit 00e5e12906)

# Conflicts:
#	core/src/progress_map.rs
#	ledger/src/blockstore_processor.rs
#	ledger/src/staking_utils.rs
#	runtime/src/bank.rs
#	runtime/src/epoch_stakes.rs
#	runtime/src/serde_snapshot/tests.rs
#	runtime/src/stakes.rs
#	runtime/src/vote_account.rs

* removes backport merge conflicts

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
This commit is contained in:
mergify[bot]
2021-12-28 18:26:23 +00:00
committed by GitHub
parent bfb02029bf
commit 262b157d21
10 changed files with 77 additions and 98 deletions

View File

@@ -32,7 +32,7 @@ use {
commitment::VOTE_THRESHOLD_SIZE,
snapshot_utils::BankFromArchiveTimings,
transaction_batch::TransactionBatch,
vote_account::ArcVoteAccount,
vote_account::VoteAccount,
vote_sender_types::ReplayVoteSender,
},
solana_sdk::{
@@ -1206,7 +1206,7 @@ fn supermajority_root_from_vote_accounts<I>(
vote_accounts: I,
) -> Option<Slot>
where
I: IntoIterator<Item = (Pubkey, (u64, ArcVoteAccount))>,
I: IntoIterator<Item = (Pubkey, (u64, VoteAccount))>,
{
let mut roots_stakes: Vec<(Slot, u64)> = vote_accounts
.into_iter()
@@ -3591,7 +3591,7 @@ pub mod tests {
#[allow(clippy::field_reassign_with_default)]
fn test_supermajority_root_from_vote_accounts() {
let convert_to_vote_accounts =
|roots_stakes: Vec<(Slot, u64)>| -> Vec<(Pubkey, (u64, ArcVoteAccount))> {
|roots_stakes: Vec<(Slot, u64)>| -> Vec<(Pubkey, (u64, VoteAccount))> {
roots_stakes
.into_iter()
.map(|(root, stake)| {
@@ -3606,7 +3606,7 @@ pub mod tests {
VoteState::serialize(&versioned, vote_account.data_as_mut_slice()).unwrap();
(
solana_sdk::pubkey::new_rand(),
(stake, ArcVoteAccount::from(vote_account)),
(stake, VoteAccount::from(vote_account)),
)
})
.collect_vec()

View File

@@ -69,7 +69,7 @@ pub(crate) mod tests {
bootstrap_validator_stake_lamports, create_genesis_config, GenesisConfigInfo,
},
rand::Rng,
solana_runtime::vote_account::{ArcVoteAccount, VoteAccounts},
solana_runtime::vote_account::{VoteAccount, VoteAccounts},
solana_sdk::{
account::{from_account, AccountSharedData},
clock::Clock,
@@ -312,7 +312,7 @@ pub(crate) mod tests {
)
.unwrap();
let vote_pubkey = Pubkey::new_unique();
(vote_pubkey, (stake, ArcVoteAccount::from(account)))
(vote_pubkey, (stake, VoteAccount::from(account)))
});
let result = vote_accounts.collect::<VoteAccounts>().staked_nodes();
assert_eq!(result.len(), 2);