refactor(test): use metadata and macros; remove helpers#6
Merged
Conversation
Collaborator
Author
|
@spencer-tb suggested refactor to use framework native approach for the tests here. lmk what you think. |
4a8a3c2
into
spencer-tb:feat/eip-8037-halt-spill-refund
6 of 15 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactors current state of tests to use framework macro and metadata. Removes the need for helpers. Verified with
hasher compareand they don't produce identical fixtures in some cases because the macro optimizes non-padded things with different PUSHN sizes it seems.Claude summary when asked to
hasher compareand why it wasn't the exact sameDrops _store_data_in_memory and _create_chain_extra_regular_gas from test_state_gas_reservoir.py (~32 lines net):
the manual correction term in the test math goes away.
Behavioral equivalence verified by filling pre/post and comparing fixtures with hasher compare:
The state-root divergence is an unavoidable consequence of the framework's PUSH-minimization: a 32-byte chunk with leading zeros becomes PUSH31 <31 bytes> instead of PUSH32 <32 bytes> because both opcodes push the same 256-bit integer onto the stack (left-padded to 256 bits), so MSTORE writes identical memory.
The single-byte parent-bytecode shift cascades through codeHash → contract address → child CREATE addresses → state root, but execution gas, logs, and post-storage contents are bit-identical.
Net: same logic, same on-chain behavior, smaller test surface.