Skip to content

Commit

Permalink
Improves panic message when toggle_measurement block doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoximenes committed Dec 11, 2024
1 parent ecc4e1f commit 4f815c6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions arbitrator/tools/stylus_benchmark/src/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,17 @@ fn run(compiled_module: Vec<u8>) -> (Duration, Ink) {
panic!("unsupported request type {:?}", msg.req_type);
}

let elapsed = msg.benchmark.unwrap().elapsed.expect("elapsed");
let ink = msg.benchmark.unwrap().ink_total.expect("ink");
let benchmark_none_msg = "toggle_measurement block likely not present in program";
let elapsed = msg
.benchmark
.expect(benchmark_none_msg)
.elapsed
.expect("elapsed");
let ink = msg
.benchmark
.expect(benchmark_none_msg)
.ink_total
.expect("ink");
(elapsed, ink)
}

Expand Down

0 comments on commit 4f815c6

Please sign in to comment.