From 630f7d842513dc2d88d92ce3600673a1ecdedd66 Mon Sep 17 00:00:00 2001 From: Weiliang Li Date: Thu, 28 Nov 2019 17:56:01 +0900 Subject: [PATCH] Parameter trait for Time::Moment (#4237) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Debug for Time::Moment Without this we cannot have a Moment parameter in dispatchable functions * Update frame/support/src/traits.rs Co-Authored-By: Bastian Köcher * Update traits.rs --- substrate/frame/support/src/traits.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/substrate/frame/support/src/traits.rs b/substrate/frame/support/src/traits.rs index 167afd1b72..3de5c4770b 100644 --- a/substrate/frame/support/src/traits.rs +++ b/substrate/frame/support/src/traits.rs @@ -26,6 +26,8 @@ use sr_primitives::{ traits::{MaybeSerializeDeserialize, SimpleArithmetic, Saturating}, }; +use crate::dispatch::Parameter; + /// Anything that can have a `::len()` method. pub trait Len { /// Return the length of data type. @@ -622,7 +624,7 @@ bitmask! { } pub trait Time { - type Moment: SimpleArithmetic + FullCodec + Clone + Default + Copy; + type Moment: SimpleArithmetic + Parameter + Default + Copy; fn now() -> Self::Moment; }