Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failure to report blockfrost error when cbor decode fails #386

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pycardano/backend/blockfrost.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,13 @@
cbor = cbor.hex()
with tempfile.NamedTemporaryFile(delete=False, mode="w") as f:
f.write(cbor)
result = self.api.transaction_evaluate(f.name).result

result = self.api.transaction_evaluate(f.name)

Check warning on line 314 in pycardano/backend/blockfrost.py

View check run for this annotation

Codecov / codecov/patch

pycardano/backend/blockfrost.py#L314

Added line #L314 was not covered by tests
os.remove(f.name)
if not hasattr(result, "result"):
raise TransactionFailedException(result)

Check warning on line 317 in pycardano/backend/blockfrost.py

View check run for this annotation

Codecov / codecov/patch

pycardano/backend/blockfrost.py#L317

Added line #L317 was not covered by tests
else:
result = result.result

Check warning on line 319 in pycardano/backend/blockfrost.py

View check run for this annotation

Codecov / codecov/patch

pycardano/backend/blockfrost.py#L319

Added line #L319 was not covered by tests
return_val = {}
if not hasattr(result, "EvaluationResult"):
raise TransactionFailedException(result)
Expand Down
Loading