test_exchange_full_stack()¶
Documentation for tests/amsterdam/eip8024_dupn_swapn_exchange/test_exchange.py::test_exchange_full_stack@02aafd78.
Generate fixtures for these test cases for Bogota with:
fill -v tests/amsterdam/eip8024_dupn_swapn_exchange/test_exchange.py::test_exchange_full_stack --fork Bogota
Test EXCHANGE succeeds on a completely full stack.
EXCHANGE swaps in place without pushing, so it must work at the stack limit. The top 30 items hold their 1-indexed position from the top; EXCHANGE[n, m] swaps positions n + 1 and m + 1, then every window item is stored and checked. The topmost item is popped unstored to make room for the SSTORE keys: no valid pair can touch position 1, and a misplaced swap there still corrupts a checked slot.
Source code in tests/amsterdam/eip8024_dupn_swapn_exchange/test_exchange.py
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | |
Parametrized Test Cases¶
This test generates 3 parametrized test cases across 2 forks.