Skip to content

Commit 778bfc2

Browse files
Print difference in gas used
1 parent b239f36 commit 778bfc2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/instances/eth_runner/src/post_check.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,14 @@ pub fn post_check(
264264
receipt.transaction_index
265265
)
266266
}
267+
// Check gas used
268+
if res.gas_used != zk_ee::utils::u256_to_u64_saturated(&receipt.gas_used) {
269+
println!(
270+
"Transaction {} has a gas mismatch: ZKsync OS used {}, reference: {}\n Difference:{}",
271+
receipt.transaction_index, res.gas_used, receipt.gas_used,
272+
zk_ee::utils::u256_to_u64_saturated(&receipt.gas_used).abs_diff(res.gas_used)
273+
)
274+
}
267275
// Logs check
268276
assert_eq!(
269277
res.logs.len(),

0 commit comments

Comments
 (0)