Skip to content

Commit

Permalink
fix(tests): fix unit tests and use Bytecode verbatim (#1137)
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast authored Jan 28, 2025
1 parent b8edede commit fd62bd3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/ethereum_test_vm/tests/test_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ def test_bytecode_concatenation_with_bytes():
assert code == bytes([0x60, 0xFF, 0x19, 0x01, 0x02])

assert str(code) == ""
assert code.popped_stack_items == code.popped_stack_items
assert code.pushed_stack_items == code.pushed_stack_items
assert code.max_stack_height == code.max_stack_height
assert code.min_stack_height == code.min_stack_height
assert code.terminating == code.terminating
assert code.popped_stack_items == base.popped_stack_items
assert code.pushed_stack_items == base.pushed_stack_items
assert code.max_stack_height == base.max_stack_height
assert code.min_stack_height == base.min_stack_height
assert code.terminating == base.terminating
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def test_eof_validity(
name="imm1",
sections=[
Section.Code(
code=Op.CALLF + Op.STOP,
code=Op.CALLF + b"\x00",
)
],
),
Expand All @@ -201,7 +201,7 @@ def test_eof_validity(
code=Op.PUSH0 + Op.PUSH0 + Op.CALLF[1] + Op.STOP,
),
Section.Code(
code=Op.CALLF + Op.STOP, # would be valid with "02" + Op.RETF.
code=Op.CALLF + b"\x00", # would be valid with "02" + Op.RETF.
code_inputs=2,
code_outputs=1,
max_stack_height=2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def test_legacy_initcode_invalid_eof_v1_contract(
Container(
name="imm1",
sections=[
Section.Code(Op.DATALOADN + Op.STOP),
Section.Code(Op.DATALOADN + b"\x00"),
Section.Data(b"\xff" * 32),
],
),
Expand All @@ -204,7 +204,7 @@ def test_legacy_initcode_invalid_eof_v1_contract(
max_stack_height=1,
),
Section.Code(
Op.DATALOADN + Op.STOP,
Op.DATALOADN + b"\x00",
code_outputs=1,
),
Section.Code(
Expand Down

0 comments on commit fd62bd3

Please sign in to comment.