test_swapn_with_dup1_and_push()¶
Documentation for tests/amsterdam/eip8024_dupn_swapn_exchange/test_swapn.py::test_swapn_with_dup1_and_push@5c024cbb.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip8024_dupn_swapn_exchange/test_swapn.py::test_swapn_with_dup1_and_push --fork Amsterdam
Test SWAPN swapping top and bottom after building stack with DUP1.
Stack layout: PUSH1(1) PUSH1(0) DUP1*15 PUSH1(2) SWAPN[0x80] Before SWAPN: [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1] After SWAPN[0x80] (decode_single(0x80)=17, swaps pos 1 and 18): [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2] Result: 18 stack items, top=1, bottom=2, rest=0
Source code in tests/amsterdam/eip8024_dupn_swapn_exchange/test_swapn.py
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 | |
Parametrized Test Cases¶
This test generates 1 parametrized test case across 1 fork.