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
+4
View File
@@ -1180,6 +1180,10 @@ impl_runtime_apis! {
Babe::current_epoch()
}
fn next_epoch() -> sp_consensus_babe::Epoch {
Babe::next_epoch()
}
fn generate_key_ownership_proof(
_slot_number: sp_consensus_babe::SlotNumber,
authority_id: sp_consensus_babe::AuthorityId,