Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions bin/morph-statetest/tests/fee_token_internal_calls.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//! Golden roots/logs generated by morph-geth 5744b8f66 (Emerald and Jade).
//! The gas constants are transaction totals; geth's statetest tool subtracts
//! intrinsic gas when the total is at least the intrinsic cost.
use morph_statetest::runner::run_suite_str;

#[test]
fn fee_token_calls_match_geth() {
let outcomes = run_suite_str(include_str!("fixtures/fee_token_internal_calls.json")).unwrap();
assert_eq!(outcomes.len(), 24);
for outcome in outcomes {
assert!(
outcome.pass,
"{} / {}: {}",
outcome.test, outcome.fork, outcome.error_msg
);
let gas = match outcome.test.as_str() {
"deduct_clear" => 16_800,
"main_revert" => 16_804,
"main_oog" => 95_200,
"main_restores_cleared_slot" => 23_291,
"balance_writes" => 0,
"zero_fee_reads_balance" => 23_574,
"deduct_keep"
| "origin_guard"
| "gasprice_guard"
| "refund_false_keeps_transfer"
| "zero_fee"
| "refund_revert_rolls_back_transfer" => 21_000,
name => panic!("missing gas expectation for {name}"),
};
assert_eq!(outcome.gas_used, gas, "{} / {}", outcome.test, outcome.fork);
}
}
Loading