Skip to content

test_eof_functions_contract_call_fail()

Documentation for tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_execution_function.py::test_eof_functions_contract_call_fail@83970623.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_execution_function.py::test_eof_functions_contract_call_fail --fork Osaka

Test simple contracts that are simply expected to fail on call.

Source code in tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_execution_function.py
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
@pytest.mark.parametrize("container", CALL_FAIL_CONTRACTS, ids=lambda x: x.name)
def test_eof_functions_contract_call_fail(
    state_test: StateTestFiller,
    pre: Alloc,
    container: Container,
):
    """Test simple contracts that are simply expected to fail on call."""
    env = Environment()

    sender = pre.fund_eoa()
    container_address = pre.deploy_contract(container)
    caller_contract = Op.SSTORE(Op.CALL(Op.GAS, container_address, 0, 0, 0, 0, 0), 1) + Op.STOP()
    caller_address = pre.deploy_contract(caller_contract)

    tx = Transaction(
        to=caller_address,
        gas_limit=50000000,
        gas_price=10,
        protected=False,
        data="",
        sender=sender,
    )

    post = {caller_address: Account(storage={0: 1})}

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

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) container
...fork_Osaka-blockchain_test-invalid_opcode invalid_opcode
...fork_Osaka-blockchain_test-overflow_recursive_callf overflow_recursive_callf
...fork_Osaka-blockchain_test-overflow_recursive_callf_sstore overflow_recursive_callf_sstore
...fork_Osaka-blockchain_test-overflow_recursive_callf_memory overflow_recursive_callf_memory
...fork_Osaka-state_test-invalid_opcode invalid_opcode
...fork_Osaka-state_test-overflow_recursive_callf overflow_recursive_callf
...fork_Osaka-state_test-overflow_recursive_callf_sstore overflow_recursive_callf_sstore
...fork_Osaka-state_test-overflow_recursive_callf_memory overflow_recursive_callf_memory