Add ADR-016: cardano-api new TxBodyContent#84
Conversation
Document the architectural decision to replace the legacy TxBodyContent build era type with a simplified TxBodyContent era that uses ledger types directly, eliminates the build phantom parameter, and integrates with the ADR-010 witness API.
There was a problem hiding this comment.
Pull request overview
Adds a new Architecture Decision Record (ADR-016) describing a simplified TxBodyContent era transaction-construction type for cardano-api’s experimental API, and updates the ADR index to reference it.
Changes:
- Add
docs/ADR-016-cardano-api-new-txbodycontent.mddocumenting the newTxBodyContentapproach and related types/patterns. - Update
docs/Architecture-Decision-Records.mdto include an entry for ADR-16.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/Architecture-Decision-Records.md | Adds an index entry linking to the new ADR. |
| docs/ADR-016-cardano-api-new-txbodycontent.md | Introduces ADR-016 describing the new transaction body content design and related API elements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,184 @@ | |||
| # Status | |||
|
|
|||
| -[ ] Proposed 2026-02-23 | |||
There was a problem hiding this comment.
Markdown task list item under Status is missing a space after the dash (-[ ]), so it won’t render as a checkbox. Use - [ ] Proposed 2026-02-23 (or match the emoji-based Status style used in other ADRs) so the Status section renders correctly.
| -[ ] Proposed 2026-02-23 | |
| - [ ] Proposed 2026-02-23 |
| = L.EraTx era => UnsignedTx (Ledger.Tx era) | ||
| ``` | ||
|
|
||
| The output of `makeUnsignedTx` is a ledger transaction that lacks only key witnesses. The `EraTx` constraint is carried existentially in the constructor. A `ToApiEra` type family maps ledger eras back to cardano-api eras for serialization infrastructure compatibility. |
There was a problem hiding this comment.
The UnsignedTx definition and the explanation below it don’t match: data UnsignedTx era = L.EraTx era => UnsignedTx (Ledger.Tx era) is not an existentially-quantified era (the era type parameter remains visible), yet the text says the EraTx constraint is carried existentially. Either update the type to actually hide the era (true existential) or adjust the wording/snippet to reflect a non-existential, era-indexed wrapper.
| The output of `makeUnsignedTx` is a ledger transaction that lacks only key witnesses. The `EraTx` constraint is carried existentially in the constructor. A `ToApiEra` type family maps ledger eras back to cardano-api eras for serialization infrastructure compatibility. | |
| The output of `makeUnsignedTx` is a ledger transaction that lacks only key witnesses, wrapped in an era-indexed `UnsignedTx era`. The `EraTx` constraint is attached to the constructor (as a constructor context) rather than hiding the era existentially. A `ToApiEra` type family maps ledger eras back to cardano-api eras for serialization infrastructure compatibility. |
| * 📜 [[ADR-6 Using optparse-applicative main repository]] | ||
| * 📜 [[ADR-7 CLI Output Presentation]] | ||
| * 📜 [[ADR-16 cardano-api new TxBodyContent]] | ||
|
|
There was a problem hiding this comment.
The ADR index currently jumps from ADR-7 to ADR-16, but the docs folder contains ADR-008 through ADR-015. This makes the index misleading/incomplete for navigation; consider adding the missing ADR entries (8–15) or otherwise clarifying that this list is intentionally partial.
| Note: ADR-8 through ADR-15 are present in the ADR documents but are not yet indexed here. |
Summary
TxBodyContent build eratype with a simplifiedTxBodyContent erathat uses ledger types directlyArchitecture-Decision-Records.mdwith the new entryTest plan