Skip to content

Render guard credentials and required top-level guards - #1494

Merged
palas merged 1 commit into
masterfrom
guards
Nov 6, 2026
Merged

palas merged 1 commit into
masterfrom
guards

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: "Render guard credentials and required top-level guards.".

How to trust this PR

The actual code changes is really small and straightforward. The most opinionated choice is to use null when the guard list is empty, instead of [], and it is done this way to mimic "required signatures".

Another thing we may want to change is getting rid of "required signers" from Dijkstra on.

It also includes a golden test with both key and script guards (both in provided and required).

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 01:24
Copilot AI balanced review requested due to automatic review settings November 5, 2026 01:25

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.

🟡 Changes recommended

Both new golden tests fail while decoding the non-null guard datum during signing because the required dependency fix is missing, preventing them from reaching transaction view.

1 open issue
What changed in this PR

Adds guard credentials and required top-level guards to Dijkstra transaction views, addressing the inspection work tracked in cardano-api#1382.

Changes:

  • Renders guards and optional guard datums, using null for empty collections.
  • Adds JSON and YAML golden tests covering key and script guards.
  • Updates existing Dijkstra fixtures and adds a changelog entry.
File Description
cardano-cli/​test/​cardano-cli-golden/​Test/​Golden/​Debug/​TransactionView.hs Adds guard-rendering golden tests.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction/​build-raw-plutus-v4-script-witnesses.out Adds empty guard fields to script-witness output.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-sub-tx-witnesses-mint.yaml Updates witness/mint YAML with guard fields.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-sub-tx-witnesses-mint.json Updates witness/mint JSON with guard fields.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-sub-tx-order.yaml Adds guard fields to ordering YAML.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-sub-tx-order.json Adds guard fields to ordering JSON.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-sub-tx-metadata-aux-scripts.yaml Adds guard fields to metadata/scripts YAML.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-sub-tx-metadata-aux-scripts.json Adds guard fields to metadata/scripts JSON.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-sub-tx-body-fields.yaml Records existing key guards in body-fields YAML.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-sub-tx-body-fields.json Records existing key guards in body-fields JSON.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-intervals.yaml Adds empty guard fields to intervals YAML.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-intervals.json Adds empty guard fields to intervals JSON.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-intervals-signed.yaml Updates signed intervals YAML with guard fields.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-intervals-signed.json Updates signed intervals JSON with guard fields.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-guards.yaml Adds expected guards and optional datums in YAML.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-guards.json Adds expected guards and optional datums in JSON.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-direct-deposits.yaml Adds empty guard fields to deposits YAML.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​dijkstra/​transaction-view-direct-deposits.json Adds empty guard fields to deposits JSON.
cardano-cli/​src/​Cardano/​CLI/​Compatible/​Json/​Friendly.hs Implements Dijkstra guard rendering.
.changes/​20261104_173428_cardano-cli_pablo.lamela_friendly_guards.yml Documents the transaction-view feature.

Review effort: Balanced

Base automatically changed from friendly-subtx to master November 5, 2026 19:53
@palas
palas added this pull request to the merge queue Nov 6, 2026
Merged via the queue into master with commit 65faae3 Nov 6, 2026
25 checks passed
@palas
palas deleted the guards branch November 6, 2026 14:25
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