babe: expose next epoch data (#7829)

* babe: expose next epoch data

* babe: add runtime api for next_epoch

* babe: avoid reading next authorities from storage unnecessarily

* babe: add notes about epoch duration constraints

* babe: guard against overflow

* babe: add test for fetching current and next epoch data
This commit is contained in:
André Silva
2021-01-06 11:08:29 +00:00
committed by GitHub
parent 452244514a
commit dd4625a1e7
6 changed files with 88 additions and 4 deletions
@@ -382,6 +382,10 @@ sp_api::decl_runtime_apis! {
/// Returns information regarding the current epoch.
fn current_epoch() -> Epoch;
/// Returns information regarding the next epoch (which was already
/// previously announced).
fn next_epoch() -> Epoch;
/// Generates a proof of key ownership for the given authority in the
/// current epoch. An example usage of this module is coupled with the
/// session historical module to prove that a given authority key is