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

Commit

Permalink
Clear storage before running the bench (#11109)
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
  • Loading branch information
ggwpez and shawntabrizi authored Mar 24, 2022
1 parent 666f39b commit 676932f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frame/bags-list/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ frame_benchmarking::benchmarks! {
// - both heavier's `prev` and `next` are nodes that will need to be read and written.
// - `lighter` is the bag's `head`, so the bag will need to be read and written.

// clear any pre-existing storage.
// NOTE: safe to call outside block production
List::<T>::unsafe_clear();

let bag_thresh = T::BagThresholds::get()[0];

// insert the nodes in order
Expand Down

0 comments on commit 676932f

Please sign in to comment.