mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 02:11:07 +00:00
Updating Moment to support Mul/Div with BlockNumber (#868)
* Updating Moment to support Mul/Div with BlockNumber Issue #261 * Fixed whitespace and commented code
This commit is contained in:
committed by
Robert Habermeier
parent
608f6ae5d9
commit
e368b2d158
@@ -54,15 +54,19 @@ extern crate parity_codec as codec;
|
||||
|
||||
use runtime_support::{StorageValue, Parameter};
|
||||
use runtime_support::dispatch::Result;
|
||||
use runtime_primitives::traits::{OnFinalise, SimpleArithmetic, As, Zero};
|
||||
use runtime_primitives::traits::{OnFinalise, SimpleArithmetic, Zero};
|
||||
use system::ensure_inherent;
|
||||
use rstd::ops::{Mul, Div};
|
||||
|
||||
#[cfg(any(feature = "std", test))]
|
||||
use runtime_primitives::traits::As;
|
||||
|
||||
pub trait Trait: consensus::Trait + system::Trait {
|
||||
/// The position of the required timestamp-set extrinsic.
|
||||
const TIMESTAMP_SET_POSITION: u32;
|
||||
|
||||
/// Type used for expressing timestamp.
|
||||
type Moment: Parameter + Default + SimpleArithmetic + As<Self::BlockNumber>;
|
||||
type Moment: Parameter + Default + SimpleArithmetic + Mul<Self::BlockNumber, Output = Self::Moment> + Div<Self::BlockNumber, Output = Self::Moment>;
|
||||
}
|
||||
|
||||
decl_module! {
|
||||
|
||||
Reference in New Issue
Block a user