move test fn into its own mod (#24212)
* move test fn into its own mod * pub
This commit is contained in:
parent
474080608a
commit
605036c117
@ -6,7 +6,10 @@ use {
|
||||
rayon::prelude::*,
|
||||
solana_measure::measure::Measure,
|
||||
solana_runtime::{
|
||||
accounts::{create_test_accounts, update_accounts_bench, Accounts},
|
||||
accounts::{
|
||||
test_utils::{create_test_accounts, update_accounts_bench},
|
||||
Accounts,
|
||||
},
|
||||
accounts_db::AccountShrinkThreshold,
|
||||
accounts_index::AccountSecondaryIndexes,
|
||||
ancestors::Ancestors,
|
||||
|
@ -8,7 +8,7 @@ use {
|
||||
rand::Rng,
|
||||
rayon::iter::{IntoParallelRefIterator, ParallelIterator},
|
||||
solana_runtime::{
|
||||
accounts::{create_test_accounts, AccountAddressFilter, Accounts},
|
||||
accounts::{test_utils::create_test_accounts, AccountAddressFilter, Accounts},
|
||||
accounts_db::AccountShrinkThreshold,
|
||||
accounts_index::{AccountSecondaryIndexes, ScanConfig},
|
||||
ancestors::Ancestors,
|
||||
|
@ -1311,6 +1311,10 @@ pub fn prepare_if_nonce_account<'a>(
|
||||
}
|
||||
}
|
||||
|
||||
/// A set of utility functions used for testing and benchmarking
|
||||
pub mod test_utils {
|
||||
use super::*;
|
||||
|
||||
pub fn create_test_accounts(
|
||||
accounts: &Accounts,
|
||||
pubkeys: &mut Vec<Pubkey>,
|
||||
@ -1335,6 +1339,7 @@ pub fn update_accounts_bench(accounts: &Accounts, pubkeys: &[Pubkey], slot: u64)
|
||||
accounts.store_slow_uncached(slot, pubkey, &account);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
@ -2,7 +2,7 @@
|
||||
use {
|
||||
super::*,
|
||||
crate::{
|
||||
accounts::{create_test_accounts, Accounts},
|
||||
accounts::{test_utils::create_test_accounts, Accounts},
|
||||
accounts_db::{get_temp_accounts_paths, AccountShrinkThreshold},
|
||||
bank::{Bank, StatusCacheRc},
|
||||
hardened_unpack::UnpackedAppendVecMap,
|
||||
|
Loading…
x
Reference in New Issue
Block a user