mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 23:31:07 +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:
@@ -200,7 +200,7 @@ impl<T: Trait> Module<T> {
|
||||
|
||||
/// Get the time that should have elapsed over a session if everything was working perfectly.
|
||||
pub fn ideal_session_duration() -> T::Moment {
|
||||
let block_period: T::Moment = <timestamp::Module<T>>::block_period();
|
||||
let block_period: T::Moment = <timestamp::Module<T>>::minimum_period();
|
||||
let session_length: T::BlockNumber = Self::length();
|
||||
Mul::<T::BlockNumber>::mul(block_period, session_length)
|
||||
}
|
||||
@@ -289,7 +289,7 @@ mod tests {
|
||||
authorities: NEXT_VALIDATORS.with(|l| l.borrow().iter().cloned().map(UintAuthorityId).collect()),
|
||||
}.build_storage().unwrap().0);
|
||||
t.extend(timestamp::GenesisConfig::<Test>{
|
||||
period: 5,
|
||||
minimum_period: 5,
|
||||
}.build_storage().unwrap().0);
|
||||
t.extend(GenesisConfig::<Test>{
|
||||
session_length: 2,
|
||||
|
||||
Reference in New Issue
Block a user