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

Add Transaction Metadata CBOR Retrieval Functionality #384

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bhatt-deep
Copy link
Contributor

Purpose

This PR introduces a new method tx_metadata_cbor to retrieve transaction metadata in CBOR format across different backend implementations. This feature enhances PyCardano's capabilities for querying and working with transaction metadata.

Key Changes

  1. Added a new abstract method tx_metadata_cbor to the base ChainContext class.
  2. Implemented tx_metadata_cbor for the BlockFrost backend.
  3. Implemented tx_metadata_cbor for the Kupo backend with caching and fallback to wrapped backend.
  4. Added a placeholder implementation for the Ogmios V6 backend.
  5. Updated the __init__.py file to include the new Kupo module.

…etrieval

- Implement for BlockFrost and Kupo backends
- Make slot parameter optional except for Kupo
- Add error handling and caching for Kupo implementation
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

Attention: Patch coverage is 21.62162% with 29 lines in your changes missing coverage. Please review.

Project coverage is 84.72%. Comparing base (3ca745a) to head (bf3da4a).

Files with missing lines Patch % Lines
pycardano/backend/kupo.py 13.04% 20 Missing ⚠️
pycardano/backend/blockfrost.py 10.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #384      +/-   ##
==========================================
- Coverage   85.23%   84.72%   -0.51%     
==========================================
  Files          32       32              
  Lines        4213     4250      +37     
  Branches     1060     1066       +6     
==========================================
+ Hits         3591     3601      +10     
- Misses        435      463      +28     
+ Partials      187      186       -1     

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

@cffls
Copy link
Collaborator

cffls commented Oct 19, 2024

Looks good, thanks! Could you please add some unit tests?

@bhatt-deep
Copy link
Contributor Author

Looks good, thanks! Could you please add some unit tests?

Sure, I will work on it.

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