From 1b441f7a2d0ce1d85149846483c8187f3ff1b758 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Fri, 19 Aug 2022 14:39:20 -0500 Subject: [PATCH] make test code more clear (#27260) --- runtime/src/accounts_db.rs | 3 ++- runtime/src/bank.rs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 2d83547095..adef621aac 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -5536,7 +5536,8 @@ impl AccountsDb { .fetch_add(recycle_stores_write_elapsed.as_us(), Ordering::Relaxed); } - pub fn flush_accounts_cache_slot(&self, slot: Slot) { + #[cfg(test)] + pub(crate) fn flush_accounts_cache_slot_for_tests(&self, slot: Slot) { self.flush_slot_cache(slot); } diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 7cc04184ce..ae9e54ad6b 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -6421,11 +6421,11 @@ impl Bank { } #[cfg(test)] - pub fn flush_accounts_cache_slot(&self) { + pub fn flush_accounts_cache_slot_for_tests(&self) { self.rc .accounts .accounts_db - .flush_accounts_cache_slot(self.slot()) + .flush_accounts_cache_slot_for_tests(self.slot()) } pub fn expire_old_recycle_stores(&self) { @@ -14672,7 +14672,7 @@ pub(crate) mod tests { bank1.deposit(&pubkey0, some_lamports).unwrap(); goto_end_of_slot(Arc::::get_mut(&mut bank1).unwrap()); bank1.freeze(); - bank1.flush_accounts_cache_slot(); + bank1.flush_accounts_cache_slot_for_tests(); bank1.print_accounts_stats();