Scale trait and move to u32 blocknumbers (#3357)

* Scale trait and move to u32 blocknumbers.

* Fixes

* Cleanups

* Update node/runtime/src/lib.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* Fix up some of the factory stuff.

* Update core/sr-primitives/src/traits.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Move Nonce/Index to u32 (#3361)

* Force a non-borked version of upstream crate

* Line lengths and runtime version bump
This commit is contained in:
Gavin Wood
2019-08-11 15:03:06 +02:00
committed by GitHub
parent d1161b7d36
commit 14bb115193
29 changed files with 151 additions and 82 deletions
+5 -4
View File
@@ -90,7 +90,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
use rstd::{result, ops::{Mul, Div}, cmp};
use rstd::{result, cmp};
use codec::Encode;
#[cfg(feature = "std")]
use codec::Decode;
@@ -98,7 +98,9 @@ use codec::Decode;
use inherents::ProvideInherentData;
use srml_support::{StorageValue, Parameter, decl_storage, decl_module, for_each_tuple};
use srml_support::traits::{Time, Get};
use sr_primitives::traits::{SimpleArithmetic, Zero, SaturatedConversion};
use sr_primitives::traits::{
SimpleArithmetic, Zero, SaturatedConversion, Scale
};
use sr_primitives::weights::SimpleDispatchInfo;
use system::ensure_none;
use inherents::{RuntimeString, InherentIdentifier, ProvideInherent, IsFatalError, InherentData};
@@ -207,8 +209,7 @@ for_each_tuple!(impl_timestamp_set);
pub trait Trait: system::Trait {
/// Type used for expressing timestamp.
type Moment: Parameter + Default + SimpleArithmetic
+ Mul<Self::BlockNumber, Output = Self::Moment>
+ Div<Self::BlockNumber, Output = Self::Moment>;
+ Scale<Self::BlockNumber, Output = Self::Moment>;
/// Something which can be notified when the timestamp is set. Set this to `()` if not needed.
type OnTimestampSet: OnTimestampSet<Self::Moment>;