refactor(tests): sort refund types for deterministic fixture output#2970
Merged
danceratopz merged 1 commit intoJun 10, 2026
Conversation
`build_refund_tx` iterated `set(fork.refund_types())`, whose order depends on Python's per-process string-hash randomization (no `PYTHONHASHSEED` is set in this repo). Different `fill` invocations therefore appended the extra `PUSH0` from the `AUTHORIZATION_EXISTING_AUTHORITY` branch either before or after the `STORAGE_CLEAR` SSTOREs, producing two different bytecodes and — via `contract_address_from_hash` — two different deployment addresses for the same test, and hence two different pre-state allocations and state roots. Sort by enum-member name inside the iteration so the bytecode (and therefore the contract address) is deterministic across runs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2970 +/- ##
================================================
Coverage 90.53% 90.53%
================================================
Files 535 535
Lines 32897 32897
Branches 3021 3021
================================================
Hits 29782 29782
Misses 2596 2596
Partials 519 519
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
Went with "refactor" as it's not a fix in client-facing test behavior; it just makes the output deterministically comparable. The test behavior is unchanged. |
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.
🗒️ Description
build_refund_txiteratedset(fork.refund_types()), whose order depends on Python's per-process string-hash randomization.This creates a lot of noise when one is trying to compare two different fill fixtures using
hasher compare✅ Checklist
just statictype(scope):.