Python-Cardano / pycardano

A lightweight Cardano library in Python
https://pycardano.readthedocs.io
MIT License
215 stars 67 forks source link

Add Transaction Metadata CBOR Retrieval Functionality #384

Open bhatt-deep opened 1 week ago

bhatt-deep commented 1 week ago

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.
codecov[bot] commented 1 week ago

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 :warning:
pycardano/backend/blockfrost.py 10.00% 9 Missing :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cffls commented 2 hours ago

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