From 2e0a58f258857bb180bc146bc11b06d55976f728 Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Thu, 15 Oct 2026 15:10:23 -0400 Subject: [PATCH 1/3] Show direct deposits in transaction views --- .changes/20261015_cip159_deposit_view.yml | 5 ++ .../Cardano/CLI/Compatible/Json/Friendly.hs | 16 +++++- .../Test/Golden/Debug/TransactionView.hs | 43 ++++++++++++++ .../transaction-view-direct-deposits.json | 56 +++++++++++++++++++ .../transaction-view-direct-deposits.yaml | 43 ++++++++++++++ 5 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 .changes/20261015_cip159_deposit_view.yml create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction-view-direct-deposits.json create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction-view-direct-deposits.yaml diff --git a/.changes/20261015_cip159_deposit_view.yml b/.changes/20261015_cip159_deposit_view.yml new file mode 100644 index 0000000000..68f92706d8 --- /dev/null +++ b/.changes/20261015_cip159_deposit_view.yml @@ -0,0 +1,5 @@ +project: cardano-cli +pr: 1470 +kind: + - bugfix +description: Show direct-deposit recipients and amounts in Dijkstra transaction JSON and YAML views. diff --git a/cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs b/cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs index daaeeef34b..e8ca4aa83f 100644 --- a/cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs +++ b/cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs @@ -44,6 +44,7 @@ import Cardano.CLI.Orphan () import Cardano.CLI.Type.Common (FormatJson (..), FormatYaml (..)) import Cardano.CLI.Type.MonadWarning (MonadWarning, runWarningIO) import Cardano.Crypto.Hash (hashToTextAsHex) +import Cardano.Ledger.Address qualified as L import Cardano.Ledger.Api.Tx qualified as L import Cardano.Ledger.Core qualified as C import Cardano.Ledger.Credential (credKeyHash, credScriptHash) @@ -188,6 +189,16 @@ friendlyTxBodyImpl era (Exp.UnsignedTx ledgerTx) = ] <> alonzoScriptWitnessPairs era ledgerTx <> conwayBodyPairs body + <> dijkstraBodyPairs era body + +dijkstraBodyPairs + :: Exp.Era era + -> L.TxBody C.TopTx (Exp.LedgerEra era) + -> [Aeson.Pair] +dijkstraBodyPairs era body = case era of + Exp.ConwayEra -> [] + Exp.DijkstraEra -> + ["direct deposits" .= friendlyAccountAmounts (L.unDirectDeposits $ body ^. L.directDepositsTxBodyL)] renderCollateralInputs :: L.AlonzoEraTxBody (Exp.LedgerEra era) @@ -480,7 +491,10 @@ friendlyExtraKeyWits keyhashes | otherwise = toJSON [PaymentKeyHash (coerceKeyRole kh) | kh <- Set.toList keyhashes] friendlyWithdrawals :: L.Withdrawals -> Aeson.Value -friendlyWithdrawals (L.Withdrawals ws) +friendlyWithdrawals (L.Withdrawals ws) = friendlyAccountAmounts ws + +friendlyAccountAmounts :: Map.Map L.AccountAddress Lovelace -> Aeson.Value +friendlyAccountAmounts ws | Map.null ws = Null | otherwise = array diff --git a/cardano-cli/test/cardano-cli-golden/Test/Golden/Debug/TransactionView.hs b/cardano-cli/test/cardano-cli-golden/Test/Golden/Debug/TransactionView.hs index 23dd013c68..f486b09abc 100644 --- a/cardano-cli/test/cardano-cli-golden/Test/Golden/Debug/TransactionView.hs +++ b/cardano-cli/test/cardano-cli-golden/Test/Golden/Debug/TransactionView.hs @@ -2,6 +2,7 @@ module Test.Golden.Debug.TransactionView where +import Control.Monad (void) import System.FilePath (()) import Test.Cardano.CLI.Util (execCardanoCLI, watchdogProp) @@ -49,3 +50,45 @@ hprop_golden_debug_transaction_view_conway_yaml = , "--output-yaml" ] H.diffVsGoldenFile result $ goldenDir "conway/transaction-view.yaml" + +-- | Deposits must be visible when inspecting a transaction before signing. +hprop_golden_debug_transaction_view_dijkstra_direct_deposits_json :: Property +hprop_golden_debug_transaction_view_dijkstra_direct_deposits_json = + goldenDijkstraDirectDeposits "json" + +hprop_golden_debug_transaction_view_dijkstra_direct_deposits_yaml :: Property +hprop_golden_debug_transaction_view_dijkstra_direct_deposits_yaml = + goldenDijkstraDirectDeposits "yaml" + +goldenDijkstraDirectDeposits :: String -> Property +goldenDijkstraDirectDeposits format = + watchdogProp . propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do + bodyFile <- H.noteTempFile tempDir "tx.body" + void $ + execCardanoCLI + [ "dijkstra" + , "transaction" + , "build-raw" + , "--tx-in" + , "63e6a9a8e58e48cc025cae04daaed9d36fc7b70bc292721d9f5057ae37b24981#0" + , "--tx-out" + , "addr_test1vp0t4dfa9ktc2uvv7sg9leafuhtwyu0xcj4q4kf5pqkpjwqhklklg+5000000" + , "--fee" + , "200000" + , "--direct-deposit" + , "stake_test17qvxuvh64q9zdqgrjt76d42eclk5wgdxtnsun4808cwg0dqxv5r99+20000000" + , "--direct-deposit" + , "stake_test1uz855drx5szvz845zqcnq9dc3ez8mqdkqzy7yhmpzcqwvpg59zzfl+30000000" + , "--out-file" + , bodyFile + ] + result <- + execCardanoCLI + [ "debug" + , "transaction" + , "view" + , "--tx-body-file" + , bodyFile + , "--output-" ++ format + ] + H.diffVsGoldenFile result $ goldenDir "dijkstra/transaction-view-direct-deposits." ++ format diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction-view-direct-deposits.json b/cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction-view-direct-deposits.json new file mode 100644 index 0000000000..3e8bfcc102 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction-view-direct-deposits.json @@ -0,0 +1,56 @@ +{ + "auxiliary scripts": null, + "certificates": null, + "collateral inputs": [], + "currentTreasuryValue": null, + "datums": [], + "direct deposits": [ + { + "address": "stake_test17qvxuvh64q9zdqgrjt76d42eclk5wgdxtnsun4808cwg0dqxv5r99", + "amount": "20000000 Lovelace", + "network": "Testnet", + "stake credential script hash": "186e32faa80a26810392fda6d559c7ed4721a65ce1c9d4ef3e1c87b4" + }, + { + "address": "stake_test1uz855drx5szvz845zqcnq9dc3ez8mqdkqzy7yhmpzcqwvpg59zzfl", + "amount": "30000000 Lovelace", + "network": "Testnet", + "stake credential key hash": "8f4a3466a404c11eb410313015b88e447d81b60089e25f611600e605" + } + ], + "era": "Dijkstra", + "fee": "200000 Lovelace", + "governance actions": [], + "inputs": [ + "63e6a9a8e58e48cc025cae04daaed9d36fc7b70bc292721d9f5057ae37b24981#0" + ], + "metadata": null, + "mint": null, + "outputs": [ + { + "address": "addr_test1vp0t4dfa9ktc2uvv7sg9leafuhtwyu0xcj4q4kf5pqkpjwqhklklg", + "address era": "Shelley", + "amount": { + "lovelace": 5000000 + }, + "datum": null, + "network": "Testnet", + "payment credential key hash": "5ebab53d2d9785718cf4105fe7a9e5d6e271e6c4aa0ad934082c1938", + "reference script": null, + "stake reference": null + } + ], + "redeemers": [], + "reference inputs": [], + "required signers (payment key hashes needed for scripts)": null, + "return collateral": null, + "scripts": [], + "total collateral": null, + "treasuryDonation": 0, + "validity range": { + "lower bound": null, + "upper bound": null + }, + "voters": {}, + "withdrawals": null +} \ No newline at end of file diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction-view-direct-deposits.yaml b/cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction-view-direct-deposits.yaml new file mode 100644 index 0000000000..af8357846f --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction-view-direct-deposits.yaml @@ -0,0 +1,43 @@ +auxiliary scripts: null +certificates: null +collateral inputs: [] +currentTreasuryValue: null +datums: [] +direct deposits: +- address: stake_test17qvxuvh64q9zdqgrjt76d42eclk5wgdxtnsun4808cwg0dqxv5r99 + amount: 20000000 Lovelace + network: Testnet + stake credential script hash: 186e32faa80a26810392fda6d559c7ed4721a65ce1c9d4ef3e1c87b4 +- address: stake_test1uz855drx5szvz845zqcnq9dc3ez8mqdkqzy7yhmpzcqwvpg59zzfl + amount: 30000000 Lovelace + network: Testnet + stake credential key hash: 8f4a3466a404c11eb410313015b88e447d81b60089e25f611600e605 +era: Dijkstra +fee: 200000 Lovelace +governance actions: [] +inputs: +- 63e6a9a8e58e48cc025cae04daaed9d36fc7b70bc292721d9f5057ae37b24981#0 +metadata: null +mint: null +outputs: +- address: addr_test1vp0t4dfa9ktc2uvv7sg9leafuhtwyu0xcj4q4kf5pqkpjwqhklklg + address era: Shelley + amount: + lovelace: 5000000 + datum: null + network: Testnet + payment credential key hash: 5ebab53d2d9785718cf4105fe7a9e5d6e271e6c4aa0ad934082c1938 + reference script: null + stake reference: null +redeemers: [] +reference inputs: [] +required signers (payment key hashes needed for scripts): null +return collateral: null +scripts: [] +total collateral: null +treasuryDonation: 0 +validity range: + lower bound: null + upper bound: null +voters: {} +withdrawals: null From 5bcf562c9a247109f8f42e3600e4c4ee894048be Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Thu, 22 Oct 2026 13:39:56 -0400 Subject: [PATCH 2/3] Update Plutus V4 transaction view golden for direct deposits --- .../transaction/build-raw-plutus-v4-script-witnesses.out | 1 + 1 file changed, 1 insertion(+) diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction/build-raw-plutus-v4-script-witnesses.out b/cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction/build-raw-plutus-v4-script-witnesses.out index 60db910a31..d90dcdf76b 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction/build-raw-plutus-v4-script-witnesses.out +++ b/cardano-cli/test/cardano-cli-golden/files/golden/dijkstra/transaction/build-raw-plutus-v4-script-witnesses.out @@ -9,6 +9,7 @@ currentTreasuryValue: null datums: - datum: I 24 datum hash: df5078aee07dd171a343fb99d5fc1b5462fb3c94d82bf72dc1b77d9c0aceec29 +direct deposits: null era: Dijkstra fee: 200000 Lovelace governance actions: From 2c44c1cbfb44c9dab56601e363e3a449975e3a53 Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Thu, 22 Oct 2026 15:22:22 -0400 Subject: [PATCH 3/3] Pin macOS native dependencies to iohk-nix v3.1 --- .github/workflows/haskell.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index c7cd466280..c11c1be548 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -86,6 +86,9 @@ jobs: uses: input-output-hk/actions/base@latest with: use-sodium-vrf: true # default is true + # Work around macOS foreign-library configure failures with iohk-nix v3.2. + # https://github.com/IntersectMBO/cardano-cli/actions/runs/39825029792/job/119985950591 + url-prefix: ${{ runner.os == 'macOS' && 'https://github.com/input-output-hk/iohk-nix/releases/download/v3.1' || 'https://github.com/input-output-hk/iohk-nix/releases/latest/download' }} - uses: actions/checkout@v6