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@83970623.

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
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
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
@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=Address(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-blockchain_test-opcode_CALL CALL
...fork_Osaka-blockchain_test-opcode_EXTCALL EXTCALL
...fork_Osaka-state_test-opcode_CALL CALL
...fork_Osaka-state_test-opcode_EXTCALL EXTCALL