rework bank test to specifically use BTreeMap (#19225)

This commit is contained in:
Jeff Washington (jwash) 2021-08-13 13:30:48 -05:00 committed by GitHub
parent 74cc2e5ffa
commit 1a3f29e22d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -5738,9 +5738,7 @@ pub(crate) mod tests {
use crate::{ use crate::{
accounts_background_service::{AbsRequestHandler, SendDroppedBankCallback}, accounts_background_service::{AbsRequestHandler, SendDroppedBankCallback},
accounts_db::DEFAULT_ACCOUNTS_SHRINK_RATIO, accounts_db::DEFAULT_ACCOUNTS_SHRINK_RATIO,
accounts_index::{ accounts_index::{AccountIndex, AccountSecondaryIndexes, ScanError, ITER_BATCH_SIZE},
AccountIndex, AccountMap, AccountSecondaryIndexes, ScanError, ITER_BATCH_SIZE,
},
ancestors::Ancestors, ancestors::Ancestors,
genesis_utils::{ genesis_utils::{
activate_all_features, bootstrap_validator_stake_lamports, activate_all_features, bootstrap_validator_stake_lamports,
@ -7309,9 +7307,9 @@ pub(crate) mod tests {
} }
} }
fn map_to_test_bad_range() -> AccountMap<Pubkey, i8> { fn map_to_test_bad_range() -> std::collections::BTreeMap<Pubkey, i8> {
let mut map: AccountMap<Pubkey, i8> = AccountMap::new(); let mut map = std::collections::BTreeMap::new();
// when empty, AccountMap (= std::collections::BTreeMap) doesn't sanitize given range... // when empty, std::collections::BTreeMap doesn't sanitize given range...
map.insert(solana_sdk::pubkey::new_rand(), 1); map.insert(solana_sdk::pubkey::new_rand(), 1);
map map
} }