From a30aeefec87c75d82edc55e3c4dfd5514d5a45d1 Mon Sep 17 00:00:00 2001 From: Carlos LopezDeLara Date: Thu, 11 Dec 2025 00:10:16 -0600 Subject: [PATCH] Update friendlyDRep to use CIP129 identifiers Update friendlyDRep to use CIP129 identifiers Improve query stake-address-info output now includes the correct cip129 hex format as well as the Ledger state format. This is still needed, for example, to further queries based on this output. --- .../src/Cardano/CLI/Compatible/Json/Friendly.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs b/cardano-cli/src/Cardano/CLI/Compatible/Json/Friendly.hs index 0e75e77648..f0be7ae646 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.Type.Common (FormatJson (..), FormatYaml (..)) import Cardano.CLI.Type.MonadWarning (MonadWarning, runWarningIO) import Cardano.Crypto.Hash (hashToTextAsHex) import Cardano.Ledger.Core qualified as C +import Cardano.Ledger.Credential (credKeyHash, credScriptHash) import Data.Aeson (Value (..), object, (.=)) import Data.Aeson qualified as Aeson @@ -926,10 +927,13 @@ friendlyDRep L.DRepAlwaysAbstain = "alwaysAbstain" friendlyDRep L.DRepAlwaysNoConfidence = "alwaysNoConfidence" friendlyDRep (L.DRepCredential sch@(L.ScriptHashObj (C.ScriptHash _))) = Aeson.object - [ "scriptHashHex" .= UsingRawBytesHex sch + [ "scriptHash" .= credScriptHash sch + , "cip129Hex" .= cip129SerialiseRaw sch + , "cip129Bech32" .= serialiseToBech32Cip129 sch ] friendlyDRep (L.DRepCredential kh@(L.KeyHashObj (C.KeyHash _))) = Aeson.object - [ "keyHashHex" .= UsingRawBytesHex kh - , "keyHashBech32" .= serialiseToBech32Cip129 kh + [ "keyHash" .= credKeyHash kh + , "cip129Hex" .= cip129SerialiseRaw kh + , "cip129Bech32" .= serialiseToBech32Cip129 kh ]