Uses SNAPSHOT_VERSION_FILENAME constant (#31508)

This commit is contained in:
Brooks 2023-05-05 14:00:08 -04:00 committed by GitHub
parent d8664397b6
commit c7d922f229
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -1978,7 +1978,7 @@ fn build_storage_from_snapshot_dir(
) -> Result<AccountStorageMap> {
let bank_snapshot_dir = &snapshot_info.snapshot_dir;
let snapshot_file_path = &snapshot_info.snapshot_path();
let snapshot_version_path = bank_snapshot_dir.join("version");
let snapshot_version_path = bank_snapshot_dir.join(SNAPSHOT_VERSION_FILENAME);
let (file_sender, file_receiver) = crossbeam_channel::unbounded();
let accounts_hardlinks = bank_snapshot_dir.join(SNAPSHOT_ACCOUNTS_HARDLINKS);

View File

@ -464,7 +464,10 @@ pub(crate) fn get_slot_and_append_vec_id(filename: &str) -> (Slot, usize) {
#[cfg(test)]
mod tests {
use {super::*, crate::append_vec::AppendVec};
use {
super::*,
crate::{append_vec::AppendVec, snapshot_utils::SNAPSHOT_VERSION_FILENAME},
};
#[test]
fn test_get_unique_append_vec_id() {
@ -492,7 +495,7 @@ mod tests {
assert_eq!(None, get_snapshot_file_kind("file.txt"));
assert_eq!(
Some(SnapshotFileKind::Version),
get_snapshot_file_kind("version")
get_snapshot_file_kind(SNAPSHOT_VERSION_FILENAME)
);
assert_eq!(
Some(SnapshotFileKind::BankFields),