Skip to content

Commit

Permalink
Removes unnecessary Accounts constructors (solana-labs#34471)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Dec 15, 2023
1 parent aaccbdd commit 45eaa4c
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 131 deletions.
7 changes: 4 additions & 3 deletions accounts-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use {
accounts::Accounts,
accounts_db::{
test_utils::{create_test_accounts, update_accounts_bench},
AccountShrinkThreshold, CalcAccountsHashDataSource,
AccountShrinkThreshold, AccountsDb, CalcAccountsHashDataSource,
},
accounts_index::AccountSecondaryIndexes,
ancestors::Ancestors,
Expand All @@ -19,7 +19,7 @@ use {
solana_sdk::{
genesis_config::ClusterType, pubkey::Pubkey, sysvar::epoch_schedule::EpochSchedule,
},
std::{env, fs, path::PathBuf},
std::{env, fs, path::PathBuf, sync::Arc},
};

fn main() {
Expand Down Expand Up @@ -69,12 +69,13 @@ fn main() {
if fs::remove_dir_all(path.clone()).is_err() {
println!("Warning: Couldn't remove {path:?}");
}
let accounts = Accounts::new_with_config_for_benches(
let accounts_db = AccountsDb::new_with_config_for_benches(
vec![path],
&ClusterType::Testnet,
AccountSecondaryIndexes::default(),
AccountShrinkThreshold::default(),
);
let accounts = Accounts::new(Arc::new(accounts_db));
println!("Creating {num_accounts} accounts");
let mut create_time = Measure::start("create accounts");
let pubkeys: Vec<_> = (0..num_slots)
Expand Down
Loading

0 comments on commit 45eaa4c

Please sign in to comment.