with_chained_zero_lamport_accounts works with write cache (#29104)
This commit is contained in:
parent
26472a13ea
commit
ca8372efc1
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue