with_chained_zero_lamport_accounts works with write cache (#29104)

This commit is contained in:
Jeff Washington (jwash) 2022-12-06 12:56:37 -06:00 committed by GitHub
parent 26472a13ea
commit ca8372efc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -12442,25 +12442,26 @@ pub mod tests {
let dummy_account = AccountSharedData::new(dummy_lamport, no_data, &owner);
let dummy_pubkey = Pubkey::default();
let accounts = AccountsDb::new_single_for_tests();
let mut accounts = AccountsDb::new_single_for_tests();
accounts.caching_enabled = true;
let mut current_slot = 1;
accounts.store_for_tests(current_slot, &[(&pubkey, &account)]);
accounts.store_for_tests(current_slot, &[(&purged_pubkey1, &account2)]);
accounts.add_root(current_slot);
accounts.add_root_and_flush_write_cache(current_slot);
current_slot += 1;
accounts.store_for_tests(current_slot, &[(&purged_pubkey1, &zero_lamport_account)]);
accounts.store_for_tests(current_slot, &[(&purged_pubkey2, &account3)]);
accounts.add_root(current_slot);
accounts.add_root_and_flush_write_cache(current_slot);
current_slot += 1;
accounts.store_for_tests(current_slot, &[(&purged_pubkey2, &zero_lamport_account)]);
accounts.add_root(current_slot);
accounts.add_root_and_flush_write_cache(current_slot);
current_slot += 1;
accounts.store_for_tests(current_slot, &[(&dummy_pubkey, &dummy_account)]);
accounts.add_root(current_slot);
accounts.add_root_and_flush_write_cache(current_slot);
accounts.print_accounts_stats("pre_f");
accounts.update_accounts_hash_for_tests(4, &Ancestors::default(), false, false);