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
+5 -5
View File
@@ -354,7 +354,7 @@ impl srml_system::Trait for Runtime {
}
impl srml_timestamp::Trait for Runtime {
/// A timestamp: seconds since the unix epoch.
/// A timestamp: milliseconds since the unix epoch.
type Moment = u64;
type OnTimestampSet = ();
type MinimumPeriod = MinimumPeriod;
@@ -540,7 +540,7 @@ cfg_if! {
}
impl aura_primitives::AuraApi<Block, AuraId> for Runtime {
fn slot_duration() -> u64 { 1 }
fn slot_duration() -> u64 { 1000 }
fn authorities() -> Vec<AuraId> { system::authorities() }
}
@@ -548,7 +548,7 @@ cfg_if! {
fn startup_data() -> babe_primitives::BabeConfiguration {
babe_primitives::BabeConfiguration {
median_required_blocks: 0,
slot_duration: 3,
slot_duration: 3000,
c: (3, 10),
}
}
@@ -731,7 +731,7 @@ cfg_if! {
}
impl aura_primitives::AuraApi<Block, AuraId> for Runtime {
fn slot_duration() -> u64 { 1 }
fn slot_duration() -> u64 { 1000 }
fn authorities() -> Vec<AuraId> { system::authorities() }
}
@@ -739,7 +739,7 @@ cfg_if! {
fn startup_data() -> babe_primitives::BabeConfiguration {
babe_primitives::BabeConfiguration {
median_required_blocks: 0,
slot_duration: 1,
slot_duration: 1000,
c: (3, 10),
}
}