consolidate constants related to time for future refactoring (#14440)

This commit is contained in:
Jeff Washington (jwash)
2021-01-07 09:49:24 -06:00
committed by GitHub
parent 3fc7362486
commit 938d482135
8 changed files with 12 additions and 28 deletions

View File

@ -284,10 +284,7 @@ impl fmt::Display for CliEpochInfo {
}
fn slot_to_human_time(slot: Slot) -> String {
humantime::format_duration(Duration::from_secs(
slot * clock::DEFAULT_TICKS_PER_SLOT / clock::DEFAULT_TICKS_PER_SECOND,
))
.to_string()
humantime::format_duration(Duration::from_millis(slot * clock::DEFAULT_MS_PER_SLOT)).to_string()
}
#[derive(Serialize, Deserialize, Default)]