-
Notifications
You must be signed in to change notification settings - Fork 436
Use dynamic address allocation in ported static tests #2517
Copy link
Copy link
Open
Description
Use dynamic address allocation in ported static tests
Follow-up to #2455.
The 2,180 script-ported tests in tests/ported_static/ use hardcoded addresses and sender keys throughout (~5,000 hardcoded address=Address(...) calls, ~10,000 hardcoded key=0x... values). Every test is marked @pytest.mark.pre_alloc_mutable to support this.
Standard EEST tests use dynamic allocation instead — pre.deploy_contract(code=...) returns an address, and pre.fund_eoa() returns a sender. This is more robust (no collisions, no coupling to specific address values) and lets the framework manage allocation.
What needs to change
- Remove
address=frompre.deploy_contract(...)calls and use the returned address - Replace hardcoded
EOA(key=...)withpre.fund_eoa() - Update any bytecode that embeds raw addresses to reference the dynamically allocated ones
- Remove
@pytest.mark.pre_alloc_mutableonce addresses are no longer hardcoded - Update expected
poststate to use the dynamic addresses
Notes
- This could likely best done by updating the porting script from feat(tests): add script to port static state test fixtures to Python #2455 rather than manual edits, but not certain
- Some tests embed addresses directly in
tx_data_hexbytecode blobs, those are harder to make dynamic and may need to stay hardcoded or be refactored to useOpassembly
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels