expose set_timestamp for runtime benchmarks (#8601)

* expose set_timestamp for runtime benchmarks

* Update frame/timestamp/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Xiliang Chen
2021-04-13 23:52:20 +12:00
committed by GitHub
parent f854194139
commit 3351cb8869
+1 -1
View File
@@ -258,7 +258,7 @@ impl<T: Config> Pallet<T> {
}
/// Set the timestamp to something in particular. Only used for tests.
#[cfg(feature = "std")]
#[cfg(any(feature = "runtime-benchmarks", feature = "std"))]
pub fn set_timestamp(now: T::Moment) {
Now::<T>::put(now);
}