Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
write Time documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gui1117 committed Jan 17, 2020
1 parent d4fbb89 commit 8f973d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions frame/support/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,14 @@ bitmask! {
}
}

/// A trait to query the time of the current block.
pub trait Time {
/// Type used for expressing timestamp.
type Moment: SimpleArithmetic + Parameter + Default + Copy;

/// Return the last timestamp set by inherent. If called before the inherent providing
/// timestamp for the current block (i.e. in-between blocks, in on_initialize, or in previous
/// inherents) then the moment of the previous block is returned or 0 for the first block.
fn now() -> Self::Moment;
}

Expand Down
1 change: 0 additions & 1 deletion frame/timestamp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ impl<T: Trait> ProvideInherent for Module<T> {
impl<T: Trait> Time for Module<T> {
type Moment = T::Moment;

/// Before the first set of now with inherent the value returned is zero.
fn now() -> Self::Moment {
Self::now()
}
Expand Down

0 comments on commit 8f973d2

Please sign in to comment.