Skip to content

Commit

Permalink
Use POST to fix test_bank_from_latest_snapshot_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangzhu70 committed Apr 13, 2023
1 parent ed10f0a commit e1a244a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5553,6 +5553,20 @@ mod tests {
slot_deltas,
)
.unwrap();
// Reserialize the snapshot dir to convert it from PRE to POST, because only the POST type can be used
// to construct a bank.
bank.accounts()
.accounts_db
.set_accounts_hash_for_tests(bank.slot(), AccountsHash(Hash::new(&[1; 32])));
let accounts_hash = &bank.get_accounts_hash().unwrap();
assert!(
crate::serde_snapshot::reserialize_bank_with_new_accounts_hash(
bank_snapshots_dir,
bank.slot(),
accounts_hash,
None
)
);
}

let account_paths = &bank.rc.accounts.accounts_db.paths;
Expand Down

0 comments on commit e1a244a

Please sign in to comment.