Skip to content

test_no_memory_corruption_on_upper_call_stack_levels()

Documentation for tests/cancun/eip5656_mcopy/test_mcopy_contexts.py::test_no_memory_corruption_on_upper_call_stack_levels@20373115.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/cancun/eip5656_mcopy/test_mcopy_contexts.py::test_no_memory_corruption_on_upper_call_stack_levels --fork Amsterdam

Perform a subcall with any of the following opcodes, which uses MCOPY during its execution, and verify that the caller's memory is unaffected.

Source code in tests/cancun/eip5656_mcopy/test_mcopy_contexts.py
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
@pytest.mark.with_all_call_opcodes
@pytest.mark.valid_from("Cancun")
def test_no_memory_corruption_on_upper_call_stack_levels(
    state_test: StateTestFiller,
    pre: Alloc,
    post: Mapping[str, Account],
    tx: Transaction,
) -> None:
    """
    Perform a subcall with any of the following opcodes, which uses MCOPY
    during its execution, and verify that the caller's memory is unaffected.
    """
    state_test(
        env=Environment(),
        pre=pre,
        post=post,
        tx=tx,
    )

Parametrized Test Cases

This test generates 4 parametrized test cases across 4 forks.