Use milliseconds for timestamp resolution (#3210)

* node: tabify constants file

* node: define minimum period and slot duration in milliseconds

* core: srml: use milliseconds for timestamp resolution

* core: update slot_duration to millis in tests

* node: bump spec_version

* node: fix integration test

* node: fix executor test

* Update node/runtime/src/lib.rs

Co-Authored-By: Kian Peymani <Kianenigma@users.noreply.github.com>

* node: fix docs on timestamp resolution

* node: add docs on u64 for millis
This commit is contained in:
André Silva
2019-07-26 01:40:15 +01:00
committed by Gavin Wood
parent 23fba990ba
commit a5efdd05d7
10 changed files with 47 additions and 42 deletions
+2 -2
View File
@@ -264,7 +264,7 @@ mod tests {
use consensus_common::{Environment, Proposer, BlockImportParams, BlockOrigin, ForkChoiceStrategy};
use node_primitives::DigestItem;
use node_runtime::{BalancesCall, Call, UncheckedExtrinsic};
use node_runtime::constants::{currency::CENTS, time::SECS_PER_BLOCK};
use node_runtime::constants::{currency::CENTS, time::SLOT_DURATION};
use parity_codec::{Encode, Decode};
use primitives::{
crypto::Pair as CryptoPair, blake2_256,
@@ -365,7 +365,7 @@ mod tests {
// even though there's only one authority some slots might be empty,
// so we must keep trying the next slots until we can claim one.
let babe_pre_digest = loop {
inherent_data.replace_data(timestamp::INHERENT_IDENTIFIER, &(slot_num * SECS_PER_BLOCK));
inherent_data.replace_data(timestamp::INHERENT_IDENTIFIER, &(slot_num * SLOT_DURATION));
if let Some(babe_pre_digest) = babe::test_helpers::claim_slot(
&*service.client(),
&parent_id,