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

Commit

Permalink
Use new bank constructor for tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
wen-coding committed Jan 4, 2024
1 parent ea4d800 commit 4f91be7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
1 change: 1 addition & 0 deletions wen-restart/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ rand = { workspace = true }
serial_test = { workspace = true }
solana-accounts-db = { workspace = true }
solana-entry = { workspace = true }
solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }
solana-streamer = { workspace = true }

[build-dependencies]
Expand Down
16 changes: 2 additions & 14 deletions wen-restart/src/last_voted_fork_slots_aggregate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,15 @@ mod tests {
LastVotedForkSlotsAggregateRecord, LastVotedForkSlotsRecord,
},
},
solana_accounts_db::{
accounts_db::AccountShrinkThreshold, accounts_index::AccountSecondaryIndexes,
},
solana_gossip::restart_crds_values::RestartLastVotedForkSlots,
solana_runtime::{
bank::Bank,
bank_forks::BankForks,
genesis_utils::{
create_genesis_config_with_vote_accounts, GenesisConfigInfo, ValidatorVoteKeypairs,
},
runtime_config::RuntimeConfig,
},
solana_sdk::{hash::Hash, signature::Signer, timing::timestamp},
std::{collections::HashMap, sync::Arc},
std::collections::HashMap,
};

#[test]
Expand All @@ -155,14 +150,7 @@ mod tests {
&validator_voting_keypairs,
vec![100; validator_voting_keypairs.len()],
);
let bank = Bank::new_with_paths_for_tests(
&genesis_config,
Arc::new(RuntimeConfig::default()),
Vec::new(),
AccountSecondaryIndexes::default(),
AccountShrinkThreshold::default(),
);
let bank_forks = BankForks::new_rw_arc(bank);
let (_, bank_forks) = Bank::new_with_bank_forks_for_tests(&genesis_config);
let root_bank = bank_forks.read().unwrap().root_bank();
let root_slot = root_bank.slot();
let shred_version = 52;
Expand Down
13 changes: 1 addition & 12 deletions wen-restart/src/wen_restart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ fn write_wen_restart_records(
mod tests {
use {
crate::wen_restart::*,
solana_accounts_db::{
accounts_db::AccountShrinkThreshold, accounts_index::AccountSecondaryIndexes,
},
solana_entry::entry,
solana_gossip::{
cluster_info::ClusterInfo,
Expand All @@ -274,7 +271,6 @@ mod tests {
genesis_utils::{
create_genesis_config_with_vote_accounts, GenesisConfigInfo, ValidatorVoteKeypairs,
},
runtime_config::RuntimeConfig,
},
solana_sdk::{pubkey::Pubkey, signature::Signer, timing::timestamp},
solana_streamer::socket::SocketAddrSpace,
Expand Down Expand Up @@ -307,14 +303,7 @@ mod tests {
&validator_voting_keypairs,
vec![100; validator_voting_keypairs.len()],
);
let bank = Bank::new_with_paths_for_tests(
&genesis_config,
Arc::new(RuntimeConfig::default()),
Vec::new(),
AccountSecondaryIndexes::default(),
AccountShrinkThreshold::default(),
);
let bank_forks = BankForks::new_rw_arc(bank);
let (_, bank_forks) = Bank::new_with_bank_forks_for_tests(&genesis_config);
let expected_slots = 400;
let last_vote_slot = (RestartLastVotedForkSlots::MAX_SLOTS + expected_slots)
.try_into()
Expand Down

0 comments on commit 4f91be7

Please sign in to comment.