mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 00:01:09 +00:00
Convert unnecessary storage item to static. (#3093)
* Convert unnecessary storage item to static. * Polish * 6 second blocks. * Compile fixes * Bump runtime * Fix * Another fix * Import `srml_support::traits::Get` * Export MinimumPeriod from `decl_module!` * Remove `config` from Timestamp * Clean up warnings
This commit is contained in:
@@ -52,7 +52,7 @@ pub use timestamp;
|
||||
|
||||
use rstd::{result, prelude::*};
|
||||
use parity_codec::Encode;
|
||||
use srml_support::{decl_storage, decl_module, Parameter, storage::StorageValue};
|
||||
use srml_support::{decl_storage, decl_module, Parameter, storage::StorageValue, traits::Get};
|
||||
use primitives::{
|
||||
traits::{SaturatedConversion, Saturating, Zero, One, Member, TypedKey},
|
||||
generic::DigestItem,
|
||||
@@ -243,7 +243,7 @@ impl<T: Trait> Module<T> {
|
||||
pub fn slot_duration() -> T::Moment {
|
||||
// we double the minimum block-period so each author can always propose within
|
||||
// the majority of its slot.
|
||||
<timestamp::Module<T>>::minimum_period().saturating_mul(2.into())
|
||||
<T as timestamp::Trait>::MinimumPeriod::get().saturating_mul(2.into())
|
||||
}
|
||||
|
||||
fn on_timestamp_set<H: HandleReport>(now: T::Moment, slot_duration: T::Moment) {
|
||||
|
||||
@@ -37,6 +37,7 @@ pub struct Test;
|
||||
|
||||
parameter_types! {
|
||||
pub const BlockHashCount: u64 = 250;
|
||||
pub const MinimumPeriod: u64 = 1;
|
||||
}
|
||||
|
||||
impl system::Trait for Test {
|
||||
@@ -55,6 +56,7 @@ impl system::Trait for Test {
|
||||
impl timestamp::Trait for Test {
|
||||
type Moment = u64;
|
||||
type OnTimestampSet = Aura;
|
||||
type MinimumPeriod = MinimumPeriod;
|
||||
}
|
||||
|
||||
impl Trait for Test {
|
||||
@@ -64,9 +66,6 @@ impl Trait for Test {
|
||||
|
||||
pub fn new_test_ext(authorities: Vec<u64>) -> runtime_io::TestExternalities<Blake2Hasher> {
|
||||
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap().0;
|
||||
t.extend(timestamp::GenesisConfig::<Test>{
|
||||
minimum_period: 1,
|
||||
}.build_storage().unwrap().0);
|
||||
t.extend(GenesisConfig::<Test>{
|
||||
authorities: authorities.into_iter().map(|a| UintAuthorityId(a)).collect(),
|
||||
}.build_storage().unwrap().0);
|
||||
|
||||
Reference in New Issue
Block a user