test_endofcode_behavior()¶
Documentation for tests/amsterdam/eip8024_dupn_swapn_exchange/test_exchange.py::test_endofcode_behavior@b314d18e.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip8024_dupn_swapn_exchange/test_exchange.py::test_endofcode_behavior --fork Amsterdam
Test EXCHANGE 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_pair(0) = (9, 16), so EXCHANGE swaps positions 10 and 17.
This test verifies the transaction succeeds (doesn't revert) when EXCHANGE is the last byte of the code with no immediate byte following it.
Source code in tests/amsterdam/eip8024_dupn_swapn_exchange/test_exchange.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |
Parametrized Test Cases¶
This test generates 1 parametrized test case across 1 fork.