Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangzhu70 committed Feb 3, 2023
1 parent 415369f commit d873fdc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4390,23 +4390,25 @@ 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);

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(
Expand All @@ -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");
}
}

0 comments on commit d873fdc

Please sign in to comment.