Skip to content

refactor(test-support): unify StateTest/BlockchainTest tx execution (#127)#133

Merged
mw2000 merged 1 commit into
mainfrom
refactor/unify-test-runners
May 1, 2026
Merged

refactor(test-support): unify StateTest/BlockchainTest tx execution (#127)#133
mw2000 merged 1 commit into
mainfrom
refactor/unify-test-runners

Conversation

@mw2000
Copy link
Copy Markdown
Owner

@mw2000 mw2000 commented May 1, 2026

Summary

Closes #127.

Both StateTestRunner and BlockchainTestRunner carried a near-identical validate → bump-nonce → execute → settle-fees pipeline. Drift between them was a bug factory (CREATE support, blob-base-fee handling, fee-settlement edge cases). Extracts the shared pipeline into EEVM.TestSupport.TxExecutor; both runners now sit on top of it.

Net effect:

File Before After
state_test_runner.ex 181 80
blockchain_test_runner.ex 362 295
tx_executor.ex (new) 105
Total 543 480

The StateTestRunner now goes through EEVM.Handler.Execution.run_top_level instead of EEVM.execute, picking up CREATE support that the BlockchainTest path already had — its previous :unsupported_creation early-return is gone.

Test plan

  • mix compile — clean
  • mix credo --strict — no issues
  • mix test — 4 doctests + 613 tests, 0 failures
  • StateTest and BlockchainTest fixtures both green at the same coverage as before

🤖 Generated with Claude Code

…kchainTest runners

Closes #127.

Both runners had a near-identical validate → bump-nonce → execute → settle-fees
pipeline. This commit extracts that pipeline into
EEVM.TestSupport.TxExecutor and rewrites both runners on top of it.

Net effect:
  - test/support/state_test_runner.ex: 181 → 80 lines
  - test/support/blockchain_test_runner.ex: 362 → 295 lines
  - test/support/tx_executor.ex: new, 105 lines

One source of truth means CREATE support, blob-base-fee handling, and
fee settlement edge cases can no longer drift between the two runners.

StateTestRunner now goes through EEVM.Handler.Execution.run_top_level
instead of EEVM.execute, picking up CREATE support that the
BlockchainTest path already had.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@mw2000 mw2000 merged commit 2ccc368 into main May 1, 2026
3 checks passed
@mw2000 mw2000 deleted the refactor/unify-test-runners branch May 1, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: unify StateTestRunner and BlockchainTestRunner tx execution

1 participant