Skip to content

Commit

Permalink
Fix main execution adjusted to new uplc version
Browse files Browse the repository at this point in the history
  • Loading branch information
nielstron committed Nov 28, 2024
1 parent 64fd34e commit bc7c09c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions opshin/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,14 @@ def perform_command(args):
print("Starting execution")
print("------------------")
assert isinstance(code, uplc.ast.Program)
try:
ret = uplc.eval(code)
except Exception as e:
raw_ret = uplc.eval(code)
if isinstance(raw_ret.result, Exception):
print("An exception was raised")
ret = e
ret = raw_ret.result
else:
print("Execution succeeded")
ret = uplc.dumps(ret.result)
ret = uplc.dumps(raw_ret.result)
print(f"CPU: {raw_ret.cost.cpu} | MEM: {raw_ret.cost.memory}")
print("------------------")
print(ret)

Expand Down

0 comments on commit bc7c09c

Please sign in to comment.