move package_snapshots to AccountsPackagePre ctors (#18997)

This PR solves #18815. Note that I had to make the snapshot prefix
constants inside `snapshot_utils.rs` public at the crate level in order
to make this work. I'm not sure whether or not introducing this
dependency is entirely good, either way the `snapshot_utils.rs` file
needs a lot of rework so things will move around, I believe this does
the work in the meantime. Any feedback will be greatly appreciated.
This commit is contained in:
Oliver
2021-08-04 10:03:03 -04:00
committed by GitHub
parent f7be47b8b9
commit 06e08c4840
3 changed files with 156 additions and 147 deletions

View File

@@ -55,6 +55,7 @@ mod tests {
bank_forks::BankForks,
genesis_utils::{create_genesis_config, GenesisConfigInfo},
snapshot_config::SnapshotConfig,
snapshot_package::AccountsPackagePre,
snapshot_utils::{
self, ArchiveFormat, SnapshotVersion, DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
},
@@ -254,7 +255,7 @@ mod tests {
let snapshot_path = &snapshot_config.snapshot_path;
let last_bank_snapshot_info = snapshot_utils::get_highest_bank_snapshot_info(snapshot_path)
.expect("no snapshots found in path");
let snapshot_package = snapshot_utils::package_full_snapshot(
let snapshot_package = AccountsPackagePre::new_full_snapshot_package(
last_bank,
&last_bank_snapshot_info,
snapshot_path,