babe: initialize next authorities on genesis (#7872)

* babe: initialize next authorities on genesis

* babe: add test for genesis authorities
This commit is contained in:
André Silva
2021-01-12 11:08:52 +00:00
committed by GitHub
parent 5912f81fdb
commit 6ac04e4902
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -255,6 +255,12 @@ fn can_enact_next_config() {
#[test]
fn can_fetch_current_and_next_epoch_data() {
new_test_ext(5).execute_with(|| {
// genesis authorities should be used for the first and second epoch
assert_eq!(
Babe::current_epoch().authorities,
Babe::next_epoch().authorities,
);
// 1 era = 3 epochs
// 1 epoch = 3 slots
// Eras start from 0.