Skip to content

Commit

Permalink
Merge pull request #599 from Chia-Network/value-error-repr
Browse files Browse the repository at this point in the history
[CHIA-813] add test for printing ValueError from CLVM
  • Loading branch information
arvidn authored Jul 8, 2024
2 parents 920f2b0 + 24135fd commit c69699b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,14 @@ def test_raise_program() -> None:
assert False
except ValueError as e:
assert f"{e}" == "('clvm raise', '86666f6f626172')"


def test_repr() -> None:
temp = Program.to([8, (1, "foo")])
assert f"{temp}" == "Program(ff08ffff0183666f6f80)"

try:
run_chia_program(bytes(temp), bytes.fromhex("00"), 1100000000, 0)
assert False
except ValueError as e:
assert f"{e}" == "('clvm raise', '83666f6f')"

0 comments on commit c69699b

Please sign in to comment.