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:
Gav Wood
2019-03-28 15:59:59 +01:00
committed by GitHub
parent d6927c2f3e
commit 3f348d0a18
10 changed files with 40 additions and 23 deletions
+3 -3
View File
@@ -141,7 +141,7 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
enact_delay_period: 0,
}),
timestamp: Some(TimestampConfig {
period: SECS_PER_BLOCK / 2, // due to the nature of aura the slots are 2*period
minimum_period: SECS_PER_BLOCK / 2, // due to the nature of aura the slots are 2*period
}),
treasury: Some(TreasuryConfig {
proposal_bond: Permill::from_percent(5),
@@ -298,7 +298,7 @@ pub fn testnet_genesis(
enact_delay_period: 0,
}),
timestamp: Some(TimestampConfig {
period: 2, // 2*2=4 second block time.
minimum_period: 2, // 2*2=4 second block time.
}),
treasury: Some(TreasuryConfig {
proposal_bond: Permill::from_percent(5),
@@ -367,7 +367,7 @@ mod tests {
fn local_testnet_genesis_instant() -> GenesisConfig {
let mut genesis = local_testnet_genesis();
genesis.timestamp = Some(TimestampConfig { period: 0 });
genesis.timestamp = Some(TimestampConfig { minimum_period: 1 });
genesis
}