diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index 93be48170a..6f7e34e77c 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -124,6 +124,23 @@ impl Accounts { } } + pub fn new_with_config_for_tests( + paths: Vec, + cluster_type: &ClusterType, + account_indexes: AccountSecondaryIndexes, + caching_enabled: bool, + shrink_ratio: AccountShrinkThreshold, + ) -> Self { + // will diverge + Self::new_with_config( + paths, + cluster_type, + account_indexes, + caching_enabled, + shrink_ratio, + ) + } + pub fn new_with_config_for_benches( paths: Vec, cluster_type: &ClusterType, @@ -1124,7 +1141,7 @@ mod tests { ) -> Vec { let mut hash_queue = BlockhashQueue::new(100); hash_queue.register_hash(&tx.message().recent_blockhash, fee_calculator); - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), @@ -1662,7 +1679,7 @@ mod tests { #[test] fn test_load_by_program_slot() { - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), @@ -1691,7 +1708,7 @@ mod tests { #[test] fn test_accounts_account_not_found() { - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), @@ -1715,7 +1732,7 @@ mod tests { #[test] #[should_panic] fn test_accounts_empty_bank_hash() { - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), @@ -1737,7 +1754,7 @@ mod tests { let account2 = AccountSharedData::new(3, 0, &Pubkey::default()); let account3 = AccountSharedData::new(4, 0, &Pubkey::default()); - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), @@ -1847,7 +1864,7 @@ mod tests { let account1 = AccountSharedData::new(2, 0, &Pubkey::default()); let account2 = AccountSharedData::new(3, 0, &Pubkey::default()); - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), @@ -1986,7 +2003,7 @@ mod tests { let mut loaded = vec![loaded0, loaded1]; - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), @@ -2034,7 +2051,7 @@ mod tests { #[test] fn huge_clean() { solana_logger::setup(); - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), @@ -2082,7 +2099,7 @@ mod tests { #[test] fn test_instructions() { solana_logger::setup(); - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), @@ -2371,7 +2388,7 @@ mod tests { let mut loaded = vec![loaded]; let next_blockhash = Hash::new_unique(); - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), @@ -2488,7 +2505,7 @@ mod tests { let mut loaded = vec![loaded]; let next_blockhash = Hash::new_unique(); - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), @@ -2524,7 +2541,7 @@ mod tests { #[test] fn test_load_largest_accounts() { - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( Vec::new(), &ClusterType::Development, AccountSecondaryIndexes::default(), diff --git a/runtime/src/serde_snapshot/tests.rs b/runtime/src/serde_snapshot/tests.rs index 8779182a86..5ea309d398 100644 --- a/runtime/src/serde_snapshot/tests.rs +++ b/runtime/src/serde_snapshot/tests.rs @@ -131,7 +131,7 @@ where fn test_accounts_serialize_style(serde_style: SerdeStyle) { solana_logger::setup(); let (_accounts_dir, paths) = get_temp_accounts_paths(4).unwrap(); - let accounts = Accounts::new_with_config( + let accounts = Accounts::new_with_config_for_tests( paths, &ClusterType::Development, AccountSecondaryIndexes::default(),