diff --git a/cabal.project b/cabal.project index e8f34b8e2e..1d413d56ce 100644 --- a/cabal.project +++ b/cabal.project @@ -23,8 +23,8 @@ source-repository-package type: git location: https://github.com/IntersectMBO/cardano-api subdir: cardano-api - tag: 955aefdcbdedb2959f176e03da80e82ce27fc879 - --sha256: sha256-Eph4eFuS4+Y8JqrJ/JfI9r6CT0Ec4H9hQFPcilebEQc= + tag: 07cfd58f4ffabc96391bba53d2f464b859be0a6a + --sha256: sha256-3Hdp3g/F1py8Lnev2Dk+eMBukPmmjsz1bnupkuYMgjA= program-options ghc-options: -Werror diff --git a/cardano-cli/src/Cardano/CLI/Json/Friendly.hs b/cardano-cli/src/Cardano/CLI/Json/Friendly.hs index 330d483930..0570dd6ba2 100644 --- a/cardano-cli/src/Cardano/CLI/Json/Friendly.hs +++ b/cardano-cli/src/Cardano/CLI/Json/Friendly.hs @@ -311,6 +311,7 @@ getAlonzoSpecificDetails aeo tb = let ShelleyTx _ ledgerTx = makeSignedTransaction [] tb in [ "redeemers" .= friendlyRedeemers ledgerTx , "scripts" .= friendlyScriptData ledgerTx + , "datums" .= friendlyDats ledgerTx ] where friendlyRedeemers @@ -398,6 +399,18 @@ getAlonzoSpecificDetails aeo tb = ] | (scriptHash, scriptData) <- Map.toList $ tx ^. Ledger.witsTxL . Ledger.scriptTxWitsL] + friendlyDats :: Ledger.Tx (ShelleyLedgerEra era) -> Aeson.Value + friendlyDats tx = + alonzoEraOnwardsConstraints aeo $ + let Ledger.TxDats dats = tx ^. Ledger.witsTxL . Ledger.datsTxWitsL in + Aeson.Array $ Vector.fromList $ + [ Aeson.Object $ KeyMap.fromList [ + "datum hash" .= datHash, + "datum" .= Api.friendlyDatum dat + ] + | (datHash, dat) <- Map.toList dats + ] + friendlyTotalCollateral :: TxTotalCollateral era -> Aeson.Value friendlyTotalCollateral TxTotalCollateralNone = Aeson.Null friendlyTotalCollateral (TxTotalCollateral _ coll) = toJSON coll diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/alonzo/signed-transaction-view.out b/cardano-cli/test/cardano-cli-golden/files/golden/alonzo/signed-transaction-view.out index 70fb432671..e6f1a37059 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/alonzo/signed-transaction-view.out +++ b/cardano-cli/test/cardano-cli-golden/files/golden/alonzo/signed-transaction-view.out @@ -2,6 +2,7 @@ auxiliary scripts: null certificates: null collateral inputs: - c9765d7d0e3955be8920e6d7a38e1f3f2032eac48c7c59b0b9193caa87727e7e#256 +datums: [] era: Alonzo fee: 213 Lovelace inputs: diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/alonzo/transaction-view.out b/cardano-cli/test/cardano-cli-golden/files/golden/alonzo/transaction-view.out index 827e0b9c2b..8c812c11fc 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/alonzo/transaction-view.out +++ b/cardano-cli/test/cardano-cli-golden/files/golden/alonzo/transaction-view.out @@ -2,6 +2,7 @@ auxiliary scripts: null certificates: null collateral inputs: - c9765d7d0e3955be8920e6d7a38e1f3f2032eac48c7c59b0b9193caa87727e7e#256 +datums: [] era: Alonzo fee: 213 Lovelace inputs: diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-metadata-detailedschema.out b/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-metadata-detailedschema.out index 1ef0554b79..be78001b74 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-metadata-detailedschema.out +++ b/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-metadata-detailedschema.out @@ -1,6 +1,7 @@ auxiliary scripts: null certificates: null collateral inputs: [] +datums: [] era: Babbage fee: 21300 Lovelace inputs: diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-metadata-noschema.out b/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-metadata-noschema.out index 99f59c01e4..cf8e9d0264 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-metadata-noschema.out +++ b/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-metadata-noschema.out @@ -1,6 +1,7 @@ auxiliary scripts: null certificates: null collateral inputs: [] +datums: [] era: Babbage fee: 21300 Lovelace inputs: diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-redeemer.out b/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-redeemer.out index 2da234d28e..90b60cb81b 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-redeemer.out +++ b/cardano-cli/test/cardano-cli-golden/files/golden/babbage/transaction-view-redeemer.out @@ -2,6 +2,9 @@ auxiliary scripts: null certificates: null collateral inputs: - c9765d7d0e3955be8920e6d7a38e1f3f2032eac48c7c59b0b9193caa87727e7e#256 +datums: +- datum: I 6666 + datum hash: 9e478573ab81ea7a8e31891ce0648b81229f408d596a3483e6f4f9b92d3cf710 era: Babbage fee: 213 Lovelace inputs: diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/conway/tx-proposal.out.json b/cardano-cli/test/cardano-cli-golden/files/golden/conway/tx-proposal.out.json index e2759c686a..b5655243b9 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/conway/tx-proposal.out.json +++ b/cardano-cli/test/cardano-cli-golden/files/golden/conway/tx-proposal.out.json @@ -3,6 +3,7 @@ "certificates": null, "collateral inputs": [], "currentTreasuryValue": null, + "datums": [], "era": "Conway", "fee": "181517 Lovelace", "governance actions": [ diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/conway/tx-three-votes-view.out.json b/cardano-cli/test/cardano-cli-golden/files/golden/conway/tx-three-votes-view.out.json index 0b86ef0a94..72c1f0ac7d 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/conway/tx-three-votes-view.out.json +++ b/cardano-cli/test/cardano-cli-golden/files/golden/conway/tx-three-votes-view.out.json @@ -3,6 +3,7 @@ "certificates": null, "collateral inputs": [], "currentTreasuryValue": null, + "datums": [], "era": "Conway", "fee": "185433 Lovelace", "governance actions": [],