mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Ensure timestamp config makes sense. (#2132)
* Timestamp period should be expressed as expected period * Fix test * Ensure value never illegal * Rename * Remove println * Add default * Comment * Fix, bump and rebuild wasm * Fix test * Add TODOs * Configure only minimum_period. * Fix * Update srml/timestamp/src/lib.rs Co-Authored-By: gavofyork <github@gavwood.com> * Update srml/timestamp/src/lib.rs Co-Authored-By: gavofyork <github@gavwood.com>
This commit is contained in:
@@ -165,7 +165,7 @@ impl<T: Trait> Module<T> {
|
||||
pub fn slot_duration() -> u64 {
|
||||
// we double the minimum block-period so each author can always propose within
|
||||
// the majority of their slot.
|
||||
<timestamp::Module<T>>::block_period().as_().saturating_mul(2)
|
||||
<timestamp::Module<T>>::minimum_period().as_().saturating_mul(2)
|
||||
}
|
||||
|
||||
fn on_timestamp_set<H: HandleReport>(now: T::Moment, slot_duration: T::Moment) {
|
||||
|
||||
@@ -68,7 +68,7 @@ pub fn new_test_ext(authorities: Vec<u64>) -> runtime_io::TestExternalities<Blak
|
||||
authorities: authorities.into_iter().map(|a| UintAuthorityId(a)).collect(),
|
||||
}.build_storage().unwrap().0);
|
||||
t.extend(timestamp::GenesisConfig::<Test>{
|
||||
period: 1,
|
||||
minimum_period: 1,
|
||||
}.build_storage().unwrap().0);
|
||||
t.into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user