Skip to content

Conversation

palas
Copy link
Contributor

@palas palas commented Sep 18, 2025

Changelog

- description: |
    Added `HasTypeProxy` `FromCBOR`, `ToCBOR`, and `SerialiseAsCBOR ` instances to `TxOut`.
  type:
  - feature
  projects:
  - cardano-api

Context

This PR addresses #955.

How to trust this PR

The test should help with trust. But there is a bit of an issue with ToCBOR instance losing information, so there is a design decision to be make about this. Please, let me know what you think about this.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@palas palas force-pushed the SerialiseAsCBOR-for-TxOut branch from e9c48c5 to 753f06b Compare September 22, 2025 17:19
Comment on lines +124 to +125
(TxOutSupplementalDatum aeo d) ->
TxOut aie val (TxOutDatumHash aeo (hashScriptDataBytes d)) rs
Copy link
Contributor

@carbolymer carbolymer Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how usable will be such deserialised txout. I think after you convert datum to hash, it's no longer included in the transaction datums: https://github.com/IntersectMBO/cardano-api/pull/814/files?diff=split&w=1#diff-dbfef7b82f6c05596cde61360e58ef674ad0bea7ac8c3e416178ccbde84b98b9R3107

Tactical merge block, since we're still discussing design.

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.

make a deserialiseFromCbor instance for TxOut
2 participants