Skip to content

Commit

Permalink
new(test): add tests for EOF/EIP-663 DUPN SWAPN
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Apr 12, 2024
1 parent 2cd20f1 commit 5a3160f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/prague/eip663_dupn_swapn_exchange/test_dupn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import pytest

from ethereum_test_tools import *

REFERENCE_SPEC_GIT_PATH = "EIPS/eip-663.md"
REFERENCE_SPEC_VERSION = "6aed382f86258f33603f5dc275956f739aaae096"
CODE_ADDRESS = 0xc0de


@pytest.mark.valid_from("Prague")
def test_dupn_example1(
state_test: StateTestFiller,
):
code_hex = "ef0001010004020001020904000000008001026001600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002600260026002e6ff60005560015500"
code = bytes.fromhex(code_hex)

pre = {
TestAddress: Account(balance=1_000_000_000),
CODE_ADDRESS: Account(code=code),
}

post = {
CODE_ADDRESS: Account(storage={0: 1, 1: 2})
}

tx = Transaction(
to=CODE_ADDRESS,
gas_limit=1_000_000
)

state_test(
env=Environment(),
pre=pre,
post=post,
tx=tx,
)

0 comments on commit 5a3160f

Please sign in to comment.