Add getBlockTime rpc api (#7130)

* Add getBlockTime rpc api

* Add getBlockTime to docs

* Fix duration rounding for common tick/slot durations; add slot duration calculation

* Expose slots_per_year

* Use genesis values instead of clock defaults to calculate block offset

* Add get-block-time cli subcommand

* Fix test_rent: decrease magic number usage
This commit is contained in:
Tyera Eulberg
2019-11-26 00:40:36 -07:00
committed by GitHub
parent 280315a314
commit 58c144ee55
12 changed files with 336 additions and 47 deletions

View File

@@ -28,6 +28,8 @@ impl PohConfig {
impl Default for PohConfig {
fn default() -> Self {
Self::new_sleep(Duration::from_millis(1000 / DEFAULT_TICKS_PER_SECOND))
Self::new_sleep(Duration::from_micros(
1000 * 1000 / DEFAULT_TICKS_PER_SECOND,
))
}
}