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

Conversation

kieransimkin
Copy link
Contributor

Sometimes the blockfrost API does not return a result set containing "result" field, so I was getting an exception out of pycardano which didn't actually show the message I was getting back from blockfrost. I've fixed this so you now get back the error from blockfrost in all circumstances.

For reference, the error I was getting was:
pycardano.exception.TransactionFailedException: Namespace(fault=Namespace(code='client', string='Invalid request: Deserialisation failure while decoding serialised transaction. CBOR failed with error: DeserialiseFailure 0 "expected tag".'), reflection=Namespace(id='efc3ec98-219f-43db-9f58-a6e2ed9fbaea'), servicename='ogmios', type='jsonwsp/fault', version='1.0')

I am still not entirely sure why my cbor is failing to decode, but I'm pretty sure the problem is with my minting script (from Aiken), not pycardano :)

Copy link

codecov bot commented Oct 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 85.24%. Comparing base (3034cd9) to head (e333650).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pycardano/backend/blockfrost.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #386      +/-   ##
==========================================
- Coverage   85.30%   85.24%   -0.07%     
==========================================
  Files          32       32              
  Lines        4213     4216       +3     
  Branches     1060     1061       +1     
==========================================
  Hits         3594     3594              
- Misses        434      437       +3     
  Partials      185      185              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cffls
Copy link
Collaborator

cffls commented Oct 13, 2024

Thanks for the fix. There is a minor issue in code format when running make qa:

pycardano/backend/blockfrost.py:313:1: W293 blank line contains whitespace

Might be easily fixable through make format.

@kieransimkin
Copy link
Contributor Author

whoops, I've fixed this now :)

@cffls cffls merged commit da3c8f6 into Python-Cardano:main Oct 17, 2024
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants