Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion srml/timestamp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl<T: Trait> ProvideInherent for Module<T> {
}

fn check_inherent(call: &Self::Call, data: &InherentData) -> result::Result<(), Self::Error> {
const MAX_TIMESTAMP_DRIFT: u64 = 60;
const MAX_TIMESTAMP_DRIFT: u64 = 30 * 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this refactoring from seconds to millisecons has had one or two of such incidents so far; maybe enough to consider introducing a very basic enum Time to make it a bit harder to become inconsistent in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also we could suffix the unit to all constant as MAX_TIMESTAP_DRIFT_SECS


let t: u64 = match call {
Call::set(ref t) => t.clone().saturated_into::<u64>(),
Expand Down