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
Prev Previous commit
Next Next commit
Add whitelist for DidUpdate storage on pallet_timestamp
  • Loading branch information
shawntabrizi committed Aug 16, 2020
commit 774e247d40310ace82491b7c5b79868d63873562
8 changes: 6 additions & 2 deletions frame/timestamp/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ benchmarks! {

set {
let t in 1 .. MAX_TIME;
// Ignore write to `DidUpdate` since it transient.
let did_update_key = crate::DidUpdate::hashed_key().to_vec();
frame_benchmarking::benchmarking::add_whitelist(did_update_key);
}: _(RawOrigin::None, t.into())

verify {
ensure!(Timestamp::<T>::now() == t.into(), "Time was not set.");
}
Expand All @@ -44,8 +46,10 @@ benchmarks! {
let t in 1 .. MAX_TIME;
Timestamp::<T>::set(RawOrigin::None.into(), t.into())?;
ensure!(DidUpdate::exists(), "Time was not set.");
// Ignore read/write to `DidUpdate` since it transient.
let did_update_key = crate::DidUpdate::hashed_key().to_vec();
frame_benchmarking::benchmarking::add_whitelist(did_update_key);
}: { Timestamp::<T>::on_finalize(t.into()); }

verify {
ensure!(!DidUpdate::exists(), "Time was not removed.");
}
Expand Down