Skip to content

Test Code Validation

Documentation for tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_code_validation.py.

Generate fixtures for these test cases for Prague with:

Prague only:

fill -v tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_code_validation.py --fork=Prague --evm-bin=/path/to/evm-tool-dev-version
For all forks up to and including Prague:
fill -v tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_code_validation.py --until=Prague --evm-bin=/path/to/evm-tool-dev-version

EOF V1 Code Validation tests

test_legacy_initcode_valid_eof_v1_contract(eof_test, container)

Test creating various types of valid EOF V1 contracts using legacy initcode and a contract creating transaction.

Source code in tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_code_validation.py
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
@pytest.mark.parametrize(
    "container",
    ALL_VALID,
    ids=container_name,
)
def test_legacy_initcode_valid_eof_v1_contract(
    eof_test: EOFTestFiller,
    container: Container,
):
    """
    Test creating various types of valid EOF V1 contracts using legacy
    initcode and a contract creating transaction.
    """
    assert (
        container.validity_error is None
    ), f"Valid container with validity error: {container.validity_error}"
    eof_test(
        data=bytes(container),
    )

test_legacy_initcode_invalid_eof_v1_contract(eof_test, container)

Test creating various types of valid EOF V1 contracts using legacy initcode and a contract creating transaction.

Source code in tests/prague/eip7692_eof_v1/eip3540_eof_v1/test_code_validation.py
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
@pytest.mark.parametrize(
    "container",
    ALL_INVALID,
    ids=container_name,
)
def test_legacy_initcode_invalid_eof_v1_contract(
    eof_test: EOFTestFiller,
    container: Container,
):
    """
    Test creating various types of valid EOF V1 contracts using legacy
    initcode and a contract creating transaction.
    """
    assert container.validity_error is not None, "Invalid container without validity error"
    eof_test(
        data=bytes(container),
        expect_exception=container.validity_error,
    )