Skip to content

test_jumpf_memory_context()

Documentation for tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_jumpf_execution.py::test_jumpf_memory_context@3719e927.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_jumpf_execution.py::test_jumpf_memory_context --fork Osaka

Verifies JUMPF doesn't corrupt memory.

Source code in tests/osaka/eip7692_eof_v1/eip6206_jumpf/test_jumpf_execution.py
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
def test_jumpf_memory_context(
    state_test: StateTestFiller,
    pre: Alloc,
):
    """Verifies JUMPF doesn't corrupt memory."""
    env = Environment()
    storage = Storage()
    contract_address = pre.deploy_contract(
        code=Container(
            sections=[
                Section.Code(
                    Op.SSTORE(storage.store_next(value_code_worked), value_code_worked)
                    + Op.MSTORE(0, 1)
                    + Op.JUMPF[1],
                ),
                Section.Code(
                    Op.SSTORE(storage.store_next(32), Op.MSIZE())
                    + Op.SSTORE(storage.store_next(1), Op.MLOAD(0))
                    + Op.STOP,
                ),
            ],
        ),
    )
    post = {
        contract_address: Account(
            storage=storage,
        ),
    }
    tx = Transaction(
        to=contract_address,
        gas_limit=500_000,
        sender=pre.fund_eoa(),
    )
    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