Skip to content

test_pointer_to_eof()

Documentation for tests/prague/eip7702_set_code_tx/test_set_code_txs_2.py::test_pointer_to_eof@01f496f4.

Generate fixtures for these test cases for Osaka with:

fill -v tests/prague/eip7702_set_code_tx/test_set_code_txs_2.py::test_pointer_to_eof --fork Osaka

Tx -> call -> pointer A -> EOF Pointer to eof contract works.

Source code in tests/prague/eip7702_set_code_tx/test_set_code_txs_2.py
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
@pytest.mark.valid_from("Osaka")
def test_pointer_to_eof(state_test: StateTestFiller, pre: Alloc):
    """
    Tx -> call -> pointer A -> EOF
    Pointer to eof contract works.
    """
    env = Environment()
    storage: Storage = Storage()
    sender = pre.fund_eoa()
    pointer_a = pre.fund_eoa()

    contract_a = pre.deploy_contract(
        code=Container(
            sections=[
                Section.Code(
                    code=Op.SSTORE(storage.store_next(5, "eof_call_result"), 5) + Op.STOP,
                )
            ]
        )
    )

    tx = Transaction(
        to=pointer_a,
        gas_limit=3_000_000,
        data=b"",
        value=0,
        sender=sender,
        authorization_list=[
            AuthorizationTuple(
                address=contract_a,
                nonce=0,
                signer=pointer_a,
            )
        ],
    )

    post = {pointer_a: Account(storage=storage)}
    state_test(
        env=env,
        pre=pre,
        post=post,
        tx=tx,
    )

Parametrized Test Cases

This test case is only parametrized by fork and fixture format.

Test ID (Abbreviated)
...fork_Osaka-state_test
...fork_Osaka-blockchain_test_from_state_test