Skip to content

Add support for sub-transactions in transaction view - #1492

Merged
palas merged 5 commits into
masterfrom
friendly-subtx
Nov 5, 2026
Merged

palas merged 5 commits into
masterfrom
friendly-subtx

Conversation

@palas

@palas palas commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Context

This PR is part of the effort to address: IntersectMBO/cardano-api#1382. The PR addresses the 4th checkbox of the 6th step: "Render complete embedded sub-transactions beyond their IDs and account-balance intervals.".

This PR does not add support for guard printing.

How to trust this PR

This PR is: 2 refactorings + 2 new lines + tests.

Look at the commits one by one.

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
  • Changelog fragment added in .changes/

@palas palas self-assigned this Oct 31, 2026
Copilot AI balanced review requested due to automatic review settings October 31, 2026 03:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

, ["--tx-body-file", bodyFile, "--signing-key-file", key, "--out-file", signedFile]
]
["dijkstra", "transaction", "sign"]
++ ["--tx-body-file", bodyFile, "--signing-key-file", key, "--out-file", signedFile]

@palas palas Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These were required by hlint

@palas palas changed the title Friendly subtx Add support for sub-transactions in transaction view Oct 31, 2026

@Jimbo4350 Jimbo4350 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should use cardano-api’s TxBodyContent and SubTxBodyContent definitions to drive this rendering. They already encode the top/sub field distinction, which this PR maintains separately through sharedTxPairs and dijkstraTopLevelPairs.

For example, expose a conversion in the API:

decomposeSignedTx
  :: SignedTx era
  -> (TxBodyContent (LedgerEra era), [KeyWitness era])

Then the CLI could render the result:

let (bodyContent, keyWitnesses) = decomposeSignedTx tx
in renderBodyContent bodyContent
    <> renderKeyWitnesses keyWitnesses

We’d need the corresponding conversion for sub-transactions and ensure body content preserves the decoded scripts, datums, and redeemers. This would keep transaction structure in the API and friendly formatting in the CLI, reducing the places we need to update when fields change.

@palas
palas added this pull request to stack #1495 November 5, 2026 01:24
@palas
palas added this pull request to the merge queue Nov 5, 2026
Merged via the queue into master with commit 294ac6a Nov 5, 2026
26 checks passed
@palas
palas deleted the friendly-subtx branch November 5, 2026 19:53
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.

3 participants