consensus-slots: cleanup SlotDuration config (#10878)

* consensus-slots: cleanup the SlotDuration config

* fix tests

* address review comments
This commit is contained in:
André Silva
2022-02-22 19:39:16 +00:00
committed by GitHub
parent f00404bfd6
commit 2561e11ed7
19 changed files with 161 additions and 191 deletions
+6 -3
View File
@@ -212,7 +212,7 @@ pub fn new_partial(
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let slot =
sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_duration(
sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
slot_duration,
);
@@ -419,7 +419,7 @@ pub fn new_full_base(
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();
let slot =
sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_duration(
sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
slot_duration,
);
@@ -650,7 +650,10 @@ mod tests {
.epoch_changes()
.shared_data()
.epoch_data(&epoch_descriptor, |slot| {
sc_consensus_babe::Epoch::genesis(&babe_link.config(), slot)
sc_consensus_babe::Epoch::genesis(
babe_link.config().genesis_config(),
slot,
)
})
.unwrap();