Skip to content

Commit

Permalink
migrate tests to not use AccountStorage::get (solana-labs#29464)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored and gnapoli23 committed Jan 10, 2023
1 parent 450ff70 commit 379b197
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10978,7 +10978,7 @@ pub mod tests {
assert!(db.load_without_fixed_root(&ancestors, &key).is_none());
assert!(db.bank_hashes.read().unwrap().get(&unrooted_slot).is_none());
assert!(db.accounts_cache.slot_cache(unrooted_slot).is_none());
assert!(db.storage.get(&unrooted_slot).is_none());
assert!(db.storage.get_slot_stores(unrooted_slot).is_none());
assert!(db.accounts_index.get_account_read_entry(&key).is_none());
assert!(db
.accounts_index
Expand Down Expand Up @@ -11360,8 +11360,9 @@ pub mod tests {
//slot is gone
accounts.print_accounts_stats("pre-clean");
accounts.add_root_and_flush_write_cache(1);
assert!(accounts.storage.get_slot_stores(0).is_some());
accounts.clean_accounts_for_tests();
assert!(accounts.storage.get(&0).is_none());
assert!(accounts.storage.get_slot_stores(0).is_none());

//new value is there
let ancestors = vec![(1, 1)].into_iter().collect();
Expand Down

0 comments on commit 379b197

Please sign in to comment.