From bc7c09c82ea791d32c09ef786b92886ead4ab461 Mon Sep 17 00:00:00 2001 From: Niels Date: Thu, 28 Nov 2024 15:24:06 +0100 Subject: [PATCH] Fix main execution adjusted to new uplc version --- opshin/__main__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opshin/__main__.py b/opshin/__main__.py index 8ace4f0..b582653 100644 --- a/opshin/__main__.py +++ b/opshin/__main__.py @@ -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)