Repository navigation
Add support for sub-transactions in transaction view - #1492
Conversation
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
These were required by hlint
transaction view
There was a problem hiding this comment.
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 keyWitnessesWe’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.
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
.changes/