Skip to content

test_max_code_size_external_opcodes()

Documentation for tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py::test_max_code_size_external_opcodes@5c024cbb.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py::test_max_code_size_external_opcodes --fork Amsterdam

Ensure external code opcodes work with the new max contract size.

Source code in tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
def test_max_code_size_external_opcodes(
    state_test: StateTestFiller,
    pre: Alloc,
    fork: Fork,
    max_code_size_contract: tuple,
) -> None:
    """Ensure external code opcodes work with the new max contract size."""
    target, target_code = max_code_size_contract

    alice = pre.fund_eoa()

    tx = Transaction(
        sender=alice,
        to=target,
        gas_limit=fork.transaction_gas_limit_cap(),
    )

    post = {
        target: Account(
            storage={
                0: len(target_code),
                1: keccak256(bytes(target_code)),
                2: keccak256(bytes(target_code)),
            }
        )
    }

    state_test(pre=pre, tx=tx, post=post)

Parametrized Test Cases

This test generates 1 parametrized test case across 1 fork.