Fix broken internal names. (#1711)
This commit is contained in:
parent
226fe8e0bb
commit
b220e07feb
@ -56,7 +56,7 @@ impl Directories {
|
||||
pub fn client_path(&self, genesis_hash: H256, fork_name: Option<&String>, pruning: Algorithm) -> PathBuf {
|
||||
let mut dir = Path::new(&self.db).to_path_buf();
|
||||
dir.push(format!("{:?}{}", H64::from(genesis_hash), fork_name.map(|f| format!("-{}", f)).unwrap_or_default()));
|
||||
dir.push(format!("v{}-sec-{}", LEGACY_CLIENT_DB_VER_STR, pruning));
|
||||
dir.push(format!("v{}-sec-{}", LEGACY_CLIENT_DB_VER_STR, pruning.as_internal_name_str()));
|
||||
dir
|
||||
}
|
||||
}
|
||||
|
@ -85,6 +85,16 @@ impl Algorithm {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns static str describing journal database algorithm.
|
||||
pub fn as_internal_name_str(&self) -> &'static str {
|
||||
match *self {
|
||||
Algorithm::Archive => "archive",
|
||||
Algorithm::EarlyMerge => "earlymerge",
|
||||
Algorithm::OverlayRecent => "overlayrecent",
|
||||
Algorithm::RefCounted => "refcounted",
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if pruning strategy is stable
|
||||
pub fn is_stable(&self) -> bool {
|
||||
match *self {
|
||||
|
Loading…
Reference in New Issue
Block a user