Skip to content

Commit

Permalink
improve code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Apr 26, 2024
1 parent 6da43f8 commit b924e3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/prague/eip663_dupn_swapn_exchange/test_dupn.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def test_dupn_all_valid_immediates(
sections=[
Section.Code(
code=b"".join(Op.PUSH2(v) for v in values)
+ b"".join(Op.DUPN(x) + Op.PUSH2(x) + Op.SSTORE for x in range(0, n))
+ b"".join(Op.SSTORE(x, Op.DUPN[x]) for x in range(0, n))
+ Op.STOP,
code_inputs=0,
code_outputs=NON_RETURNING_SECTION,
max_stack_height=258,
max_stack_height=n + 2,
)
],
)
Expand Down
6 changes: 3 additions & 3 deletions tests/prague/eip663_dupn_swapn_exchange/test_swapn.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ def test_swapn_all_valid_immediates(
"""
Test case for all valid SWAPN immediates.
"""
n = 100
n = 256
values = range(0x500, 0x500 + 257)

eof_code = Container(
sections=[
Section.Code(
code=b"".join(Op.PUSH2(v) for v in values)
+ b"".join(Op.SWAPN(0xFF - x) + Op.PUSH2(x) + Op.SSTORE for x in range(0, n))
+ b"".join(Op.SSTORE(x, Op.SWAPN[0xFF - x]) for x in range(0, n))
+ Op.STOP,
code_inputs=0,
code_outputs=NON_RETURNING_SECTION,
max_stack_height=258,
max_stack_height=n + 2,
)
],
)
Expand Down

0 comments on commit b924e3d

Please sign in to comment.