Skip to content

test_eof_calls_static_flag_with_value()

Documentation for tests/osaka/eip7692_eof_v1/eip7069_extcall/test_calls.py::test_eof_calls_static_flag_with_value@bc691d13.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip7069_extcall/test_calls.py::test_eof_calls_static_flag_with_value --fork Osaka

Test EOF contracts calls handle static flag and sending value correctly.

Source code in tests/osaka/eip7692_eof_v1/eip7069_extcall/test_calls.py
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
@pytest.mark.parametrize(
    "opcode",
    [
        Op.CALL,
        Op.EXTCALL,
    ],
)
def test_eof_calls_static_flag_with_value(
    state_test: StateTestFiller,
    pre: Alloc,
    sender: EOA,
    opcode: Op,
):
    """Test EOF contracts calls handle static flag and sending value correctly."""
    env = Environment()

    noop_callee_address = pre.deploy_contract(Container.Code(Op.STOP))

    failing_contract_code = opcode(address=noop_callee_address, value=1) + Op.STOP
    failing_contract_address = pre.deploy_contract(
        Container.Code(
            failing_contract_code,
        )
        if opcode == Op.EXTCALL
        else failing_contract_code
    )

    calling_contract_address = pre.deploy_contract(
        Container.Code(
            Op.SSTORE(slot_call_result, Op.EXTSTATICCALL(address=failing_contract_address))
            + Op.SSTORE(slot_code_worked, value_code_worked)
            + Op.STOP
        )
    )
    tx = Transaction(
        sender=sender,
        to=calling_contract_address,
        gas_limit=5_000_000,
    )

    calling_storage = {
        slot_code_worked: value_code_worked,
        slot_call_result: EXTCALL_FAILURE,
    }

    post = {
        calling_contract_address: Account(storage=calling_storage),
    }

    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) opcode
...fork_Osaka-state_test-opcode_CALL CALL
...fork_Osaka-state_test-opcode_EXTCALL EXTCALL
...fork_Osaka-blockchain_test_from_state_test-opcode_CALL CALL
...fork_Osaka-blockchain_test_from_state_test-opcode_EXTCALL EXTCALL