From d873fdccd079e1a88c6fcd8b80872bdb8f0a6b93 Mon Sep 17 00:00:00 2001 From: Xiang Zhu Date: Fri, 3 Feb 2023 11:30:19 -0800 Subject: [PATCH] minor cleanup --- runtime/src/snapshot_utils.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index 75ff246fdcbb9e..f1cad03809c3f7 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -4390,6 +4390,7 @@ mod tests { #[test] fn test_get_highest_full_snapshot_slot_and_path() { solana_logger::setup(); + let genesis_config = GenesisConfig::default(); let bank0 = Bank::new_for_tests(&genesis_config); let mut bank_forks = BankForks::new(bank0); @@ -4397,16 +4398,17 @@ mod tests { let tmp_dir = tempfile::TempDir::new().unwrap(); let bank_snapshots_dir = tmp_dir.path(); let collecter_id = Pubkey::new_unique(); - let snapshot_version = SnapshotVersion::default(); for slot in 0..4 { + // prepare the bank let parent_bank = bank_forks.get(slot).unwrap(); let bank = Bank::new_from_parent(&parent_bank, &collecter_id, slot + 1); bank.fill_bank_with_ticks_for_tests(); bank.squash(); bank.force_flush_accounts_cache(); + // generate the bank snapshot directory for slot+1 let snapshot_storages = bank.get_snapshot_storages(None); let slot_deltas = bank.status_cache.read().unwrap().root_slot_deltas(); add_bank_snapshot( @@ -4433,7 +4435,5 @@ mod tests { let (slot, _path) = get_highest_full_snapshot_slot_and_path(bank_snapshots_dir).unwrap(); assert_eq!(slot, 3); - - info!("done"); } }