Skip to content

Commit

Permalink
Fix mmr benchmark
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez committed Sep 21, 2024
1 parent b714170 commit da228d5
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions substrate/frame/beefy-mmr/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ mod benchmarks {

#[benchmark]
fn extract_validation_context() {
if !cfg!(test) {
pallet_mmr::UseLocalStorage::<T>::set(true);
}
#[cfg(test)]
pallet_mmr::UseLocalStorage::<T>::set(true);

init_block::<T>(1);
let header = System::<T>::finalize();
Expand All @@ -71,9 +70,8 @@ mod benchmarks {

#[benchmark]
fn read_peak() {
if !cfg!(test) {
pallet_mmr::UseLocalStorage::<T>::set(true);
}
#[cfg(test)]
pallet_mmr::UseLocalStorage::<T>::set(true);

init_block::<T>(1);

Expand All @@ -91,9 +89,8 @@ mod benchmarks {
/// the verification. We need to account for the peaks separately.
#[benchmark]
fn n_items_proof_is_non_canonical(n: Linear<2, 512>) {
if !cfg!(test) {
pallet_mmr::UseLocalStorage::<T>::set(true);
}
#[cfg(test)]
pallet_mmr::UseLocalStorage::<T>::set(true);

for block_num in 1..=n {
init_block::<T>(block_num);
Expand Down

0 comments on commit da228d5

Please sign in to comment.