Skip to content

test_swapn_on_max_stack()

Documentation for tests/prague/eip7692_eof_v1/eip663_dupn_swapn_exchange/test_swapn.py::test_swapn_on_max_stack@verkle@v0.0.6.

Generate fixtures for these test cases for Pragueeip7692 with:

Pragueeip7692 only:

fill -v tests/prague/eip7692_eof_v1/eip663_dupn_swapn_exchange/test_swapn.py::test_swapn_on_max_stack --fork=PragueEIP7692 --evm-bin=/path/to/evm-tool-dev-version

For all forks up to and including Pragueeip7692:

fill -v tests/prague/eip7692_eof_v1/eip663_dupn_swapn_exchange/test_swapn.py::test_swapn_on_max_stack --until=PragueEIP7692

Test case out of bounds DUPN immediate.

Source code in tests/prague/eip7692_eof_v1/eip663_dupn_swapn_exchange/test_swapn.py
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@pytest.mark.parametrize(
    "swapn_operand",
    [
        0,
        2**8 - 1,
    ],
)
@pytest.mark.valid_from(EOF_FORK_NAME)
def test_swapn_on_max_stack(
    swapn_operand: int,
    eof_test: EOFTestFiller,
):
    """
    Test case out of bounds DUPN immediate.
    """
    eof_code = Container(
        sections=[
            Section.Code(
                code=sum(Op.PUSH2[v] for v in range(0, MAX_OPERAND_STACK_HEIGHT))
                + Op.SWAPN[swapn_operand]
                + Op.STOP,
            )
        ],
    )
    eof_test(
        data=eof_code,
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Skipped Parameters

For more concise readability, the table below does not list the following parameter values: fork, blockchain_test, state_test, state_test_only, eof_test, eof_state_test.

Test ID swapn_operand
swapn_operand_0 0
swapn_operand_255 255