test_clean_zero_lamport_and_old_roots uses write cache (#29113)

This commit is contained in:
Jeff Washington (jwash) 2022-12-07 09:30:58 -06:00 committed by GitHub
parent 18a85edf8c
commit 00f5a176a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -11764,7 +11764,8 @@ pub mod tests {
fn test_clean_zero_lamport_and_old_roots() {
solana_logger::setup();
let accounts = AccountsDb::new(Vec::new(), &ClusterType::Development);
let mut accounts = AccountsDb::new(Vec::new(), &ClusterType::Development);
accounts.caching_enabled = true;
let pubkey = solana_sdk::pubkey::new_rand();
let account = AccountSharedData::new(1, 0, AccountSharedData::default().owner());
let zero_lamport_account =
@ -11776,8 +11777,10 @@ pub mod tests {
// Simulate rooting the zero-lamport account, should be a
// candidate for cleaning
accounts.add_root(0);
accounts.add_root(1);
accounts.get_accounts_delta_hash(0);
accounts.add_root_and_flush_write_cache(0);
accounts.get_accounts_delta_hash(1);
accounts.add_root_and_flush_write_cache(1);
// Slot 0 should be removed, and
// zero-lamport account should be cleaned