make test code more clear (#27260)

This commit is contained in:
Jeff Washington (jwash) 2022-08-19 14:39:20 -05:00 committed by GitHub
parent 42e227778b
commit 1b441f7a2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -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);
}

View File

@ -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::<Bank>::get_mut(&mut bank1).unwrap());
bank1.freeze();
bank1.flush_accounts_cache_slot();
bank1.flush_accounts_cache_slot_for_tests();
bank1.print_accounts_stats();