Skip to content

Test Code Validation

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

Generate fixtures for these test cases for Prague with:

Prague only:

fill -v tests/prague/eip7692_eof_v1/eip7480_data_section/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/eip7480_data_section/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/eip7480_data_section/test_code_validation.py
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
@pytest.mark.parametrize(
    "container",
    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=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/eip7480_data_section/test_code_validation.py
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
@pytest.mark.parametrize(
    "container",
    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=container,
        expect_exception=container.validity_error,
    )