Skip to content

Accept standalone sub-transaction envelopes in transaction view - #1496

Open
palas wants to merge 2 commits into
masterfrom
friendly-sep-subtx
Open

palas wants to merge 2 commits into
masterfrom
friendly-sep-subtx

Conversation

@palas

@palas palas commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Context

This PR is part of the effort to address: IntersectMBO/cardano-api#1382. The PR addresses the 5th checkbox of the 6th step: "Accept standalone signed and unsigned sub-transaction envelopes for inspection.".

Basically, we just add support for sub-transactions to transaction view. We do it both in --tx-file or --tx-body-file, the difference, as with top-transactions, is just that the list of signatures is not showed by --tx-body-file. Just for backwards compatibility, I think it would make sense to unify this.

How to trust this PR

Small change and follows the same behaviour as with top-transactions.

I would consider two things:

  • Are we sure we want to use this command and not create a new sub-transaction view?
  • Does readFileTxOrSubTx subsume readFileTxBody and readFileTx faithfully? I think it does

The PR also includes a golden file for a signed sub-transaction and an unsigned sub-transaction.

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 Nov 5, 2026
@palas
palas added this pull request to stack #1495 November 5, 2026 02:20
@palas
palas force-pushed the friendly-sep-subtx branch from 78c41b5 to d676bb2 Compare November 5, 2026 02:20
Copilot AI balanced review requested due to automatic review settings November 5, 2026 02:20
@palas palas changed the title Accept standalone signed and unsigned sub-transaction envelopes for i… Accept standalone sub-transaction envelopes in transaction view Nov 5, 2026

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.

🟢 Approval recommended

No active review issues are reported for the changes adding standalone signed and unsigned sub-transaction viewing.

No open issues 🎉

What changed in this PR

Extends transaction view to inspect standalone signed and unsigned Dijkstra sub-transactions through the existing CLI, supporting the broader sub-transaction implementation effort.

Changes:

  • Adds a shared reader for transaction and sub-transaction envelopes.
  • Supports sub-transactions with both --tx-file and --tx-body-file, omitting witnesses for the latter.
  • Adds signed and unsigned golden tests and a changelog entry.
File Description
cardano-cli/​test/​cardano-cli-golden/​Test/​Golden/​Debug/​TransactionView.hs Adds standalone signed and unsigned sub-transaction tests.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-unsigned-sub-tx.yaml Records expected unsigned output without witnesses.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-signed-sub-tx.yaml Records expected signed output with witnesses.
cardano-cli/​src/​Cardano/​CLI/​Read.hs Adds the shared transaction/sub-transaction envelope reader.
cardano-cli/​src/​Cardano/​CLI/​EraIndependent/​Debug/​TransactionView/​Run.hs Routes both input options to the appropriate renderer.
cardano-cli/​src/​Cardano/​CLI/​Compatible/​Json/​Friendly.hs Exposes sub-transaction rendering for JSON and YAML output.
.changes/​20261104_173730_cardano-cli_pablo.lamela_view_sub_tx_files.yml Documents the expanded input support.

Review effort: Balanced

Comment thread cardano-cli/src/Cardano/CLI/Read.hs Resolved
Base automatically changed from guards to master November 6, 2026 14:25
@palas
palas force-pushed the friendly-sep-subtx branch from 0bac3be to a189afa Compare November 6, 2026 14:25
@palas
palas requested a review from Jimbo4350 November 6, 2026 18:18

This branch has not been deployed

No deployments
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