test_endofcode_behavior()¶
Documentation for tests/amsterdam/eip8024_dupn_swapn_exchange/test_swapn.py::test_endofcode_behavior@c17999c0.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip8024_dupn_swapn_exchange/test_swapn.py::test_endofcode_behavior --fork Amsterdam
Test SWAPN when the immediate byte is beyond the end of code.
Per EIP-8024, code[pc + 1] evaluates to 0 if beyond the end of the code, matching PUSH behavior. With immediate = 0, decode_single(0) = 145, so SWAPN swaps position 1 with position 146.
This test verifies the transaction succeeds (doesn't revert) when SWAPN is the last byte of the code with no immediate byte following it.
Source code in tests/amsterdam/eip8024_dupn_swapn_exchange/test_swapn.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | |
Parametrized Test Cases¶
This test generates 1 parametrized test case across 1 fork.