We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f3b1f6 commit 300114dCopy full SHA for 300114d
crates/forge-runner/src/gas/report.rs
@@ -83,9 +83,10 @@ impl GasSingleTestInfo {
83
) {
84
let contract_info = self.report_data.0.entry(contract_name).or_default();
85
86
- if let Some(gas) = contract_info.gas_used.checked_add(gas_used) {
87
- contract_info.gas_used = gas;
88
- }
+ let current_gas = contract_info.gas_used;
+ contract_info.gas_used = current_gas.checked_add(gas_used).unwrap_or_else(|| {
+ panic!("Gas addition overflow when adding {gas_used:?} to {current_gas:?}.")
89
+ });
90
91
let entry = contract_info.functions.entry(selector).or_default();
92
entry.records.push(gas_used.l2_gas.0);
0 commit comments