Skip to content

Use dynamic address allocation in ported static tests #2517

@spencer-tb

Description

@spencer-tb

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= from pre.deploy_contract(...) calls and use the returned address
  • Replace hardcoded EOA(key=...) with pre.fund_eoa()
  • Update any bytecode that embeds raw addresses to reference the dynamically allocated ones
  • Remove @pytest.mark.pre_alloc_mutable once addresses are no longer hardcoded
  • Update expected post state to use the dynamic addresses

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions