diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Query/Command.hs b/cardano-cli/src/Cardano/CLI/EraBased/Query/Command.hs index e2c18a8b6c..ff9dda87e5 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Query/Command.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Query/Command.hs @@ -115,14 +115,14 @@ data QueryTipCmdArgs = QueryTipCmdArgs data QueryStakePoolsCmdArgs = QueryStakePoolsCmdArgs { commons :: !QueryCommons - , outputFormat :: !(Vary [FormatJson, FormatText]) + , outputFormat :: !(Vary [FormatJson, FormatText, FormatYaml]) , mOutFile :: !(Maybe (File () Out)) } deriving (Generic, Show) data QueryStakeDistributionCmdArgs = QueryStakeDistributionCmdArgs { commons :: !QueryCommons - , outputFormat :: !(Vary [FormatJson, FormatText]) + , outputFormat :: !(Vary [FormatJson, FormatText, FormatYaml]) , mOutFile :: !(Maybe (File () Out)) } deriving (Generic, Show) @@ -138,14 +138,14 @@ data QueryStakeAddressInfoCmdArgs = QueryStakeAddressInfoCmdArgs data QueryUTxOCmdArgs = QueryUTxOCmdArgs { commons :: !QueryCommons , queryFilter :: !QueryUTxOFilter - , outputFormat :: !(Vary [FormatCborBin, FormatCborHex, FormatJson, FormatText]) + , outputFormat :: !(Vary [FormatCborBin, FormatCborHex, FormatJson, FormatText, FormatYaml]) , mOutFile :: !(Maybe (File () Out)) } deriving (Generic, Show) data QueryLedgerStateCmdArgs = QueryLedgerStateCmdArgs { commons :: !QueryCommons - , outputFormat :: !(Vary [FormatJson, FormatText]) + , outputFormat :: !(Vary [FormatJson, FormatText, FormatYaml]) , mOutFile :: !(Maybe (File () Out)) } deriving (Generic, Show) @@ -206,7 +206,7 @@ data QuerySlotNumberCmdArgs = QuerySlotNumberCmdArgs data QueryRefScriptSizeCmdArgs = QueryRefScriptSizeCmdArgs { commons :: !QueryCommons , transactionInputs :: !(Set TxIn) - , outputFormat :: !(Vary [FormatJson, FormatText]) + , outputFormat :: !(Vary [FormatJson, FormatText, FormatYaml]) , mOutFile :: !(Maybe (File () Out)) } deriving (Generic, Show) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Query/Option.hs b/cardano-cli/src/Cardano/CLI/EraBased/Query/Option.hs index 668327897e..d0012d2420 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Query/Option.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Query/Option.hs @@ -387,6 +387,7 @@ pQueryUTxOCmd era envCli = , flagFormatCborHex , flagFormatJson & setDefault , flagFormatText + , flagFormatYaml ] <*> pMaybeOutputFile @@ -399,6 +400,7 @@ pQueryStakePoolsCmd era envCli = "stake-pools" [ flagFormatJson & setDefault , flagFormatText + , flagFormatYaml ] <*> pMaybeOutputFile @@ -411,6 +413,7 @@ pQueryStakeDistributionCmd era envCli = "stake-distribution" [ flagFormatJson & setDefault , flagFormatText + , flagFormatYaml ] <*> pMaybeOutputFile @@ -436,6 +439,7 @@ pQueryLedgerStateCmd era envCli = "ledger-state" [ flagFormatJson & setDefault , flagFormatText + , flagFormatYaml ] <*> pMaybeOutputFile @@ -592,6 +596,7 @@ pQueryRefScriptSizeCmd era envCli = "reference-script-size" [ flagFormatJson & setDefault , flagFormatText + , flagFormatYaml ] <*> pMaybeOutputFile where diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs b/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs index 5e31fdd351..beb73a1493 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs @@ -69,7 +69,6 @@ import Cardano.Slotting.Time (RelativeTime (..), toRelativeTime) import Control.Monad (forM, join) import Data.Aeson as Aeson -import Data.Aeson.Encode.Pretty qualified as Aeson import Data.Bifunctor (Bifunctor (..)) import Data.ByteString.Base16.Lazy qualified as Base16 import Data.ByteString.Lazy qualified as BS @@ -844,6 +843,7 @@ runQueryLedgerStateCmd & ( id . Vary.on (\FormatJson -> ledgerStateAsJsonByteString serialisedDebugLedgerState) . Vary.on (\FormatText -> ledgerStateAsTextByteString serialisedDebugLedgerState) + . Vary.on (\FormatYaml -> ledgerStateAsYamlByteString serialisedDebugLedgerState) $ Vary.exhaustiveCase ) ) @@ -861,7 +861,7 @@ ledgerStateAsJsonByteString ledgerStateAsJsonByteString serialisedDebugLedgerState = case decodeDebugLedgerState serialisedDebugLedgerState of Left (bs, _decoderError) -> firstExceptT QueryCmdHelpersError $ cborToTextByteString bs - Right decodededgerState -> pure $ Aeson.encode decodededgerState <> "\n" + Right decodededgerState -> pure $ Json.encodeJson decodededgerState <> "\n" ledgerStateAsTextByteString :: Applicative f @@ -870,6 +870,15 @@ ledgerStateAsTextByteString serialisedDebugLedgerState = let SerialisedDebugLedgerState serLedgerState = serialisedDebugLedgerState in pure $ unSerialised serLedgerState +ledgerStateAsYamlByteString + :: IsShelleyBasedEra era + => SerialisedDebugLedgerState era + -> ExceptT QueryCmdError IO LBS.ByteString +ledgerStateAsYamlByteString serialisedDebugLedgerState = + case decodeDebugLedgerState serialisedDebugLedgerState of + Left (bs, _decoderError) -> firstExceptT QueryCmdHelpersError $ cborToTextByteString bs + Right decodededgerState -> pure $ Json.encodeYaml decodededgerState + runQueryLedgerPeerSnapshot :: () => Cmd.QueryLedgerPeerSnapshotCmdArgs @@ -1250,7 +1259,7 @@ writePoolState outputFormat mOutFile serialisedCurrentEpochState = do writeFilteredUTxOs :: Api.ShelleyBasedEra era - -> Vary [FormatCborBin, FormatCborHex, FormatJson, FormatText] + -> Vary [FormatCborBin, FormatCborHex, FormatJson, FormatText, FormatYaml] -> Maybe (File () Out) -> UTxO era -> ExceptT QueryCmdError IO () @@ -1263,6 +1272,7 @@ writeFilteredUTxOs sbe format mOutFile utxo = do . Vary.on (\FormatCborHex -> Base16.encode . CBOR.serialize $ toLedgerUTxO sbe utxo) . Vary.on (\FormatJson -> Json.encodeJson utxo) . Vary.on (\FormatText -> strictTextToLazyBytestring $ filteredUTxOsToText sbe utxo) + . Vary.on (\FormatYaml -> Json.encodeYaml utxo) $ Vary.exhaustiveCase ) @@ -1385,7 +1395,7 @@ runQueryStakePoolsCmd -- TODO: replace with writeFormattedOutput writeStakePools - :: Vary [FormatJson, FormatText] + :: Vary [FormatJson, FormatText, FormatYaml] -> Maybe (File () Out) -> Set PoolId -> ExceptT QueryCmdError IO () @@ -1393,27 +1403,27 @@ writeStakePools format mOutFile stakePools = do let output = format & ( id - . Vary.on (\FormatJson -> writeJson) - . Vary.on (\FormatText -> writeText) + . Vary.on (\FormatJson -> Json.encodeJson) + . Vary.on (\FormatText -> encodeText) + . Vary.on (\FormatYaml -> Json.encodeYaml) $ Vary.exhaustiveCase ) + $ stakePools firstExceptT QueryCmdWriteFileError . newExceptT $ writeLazyByteStringOutput mOutFile output where - writeJson = - Aeson.encodePretty stakePools - writeText = - LBS.unlines $ - map (strictTextToLazyBytestring . serialiseToBech32) $ - toList stakePools + encodeText = + LBS.unlines + . map (strictTextToLazyBytestring . serialiseToBech32) + . toList writeFormattedOutput :: MonadIOTransError QueryCmdError t m => ToJSON a => Pretty a - => Vary [FormatJson, FormatText] + => Vary [FormatJson, FormatText, FormatYaml] -> Maybe (File b Out) -> a -> t m () @@ -1423,6 +1433,7 @@ writeFormattedOutput format mOutFile value = do & ( id . Vary.on (\FormatJson -> Json.encodeJson value) . Vary.on (\FormatText -> fromString . docToString $ pretty value) + . Vary.on (\FormatYaml -> Json.encodeYaml value) $ Vary.exhaustiveCase ) @@ -1462,7 +1473,7 @@ runQueryStakeDistributionCmd & onLeft left writeStakeDistribution - :: Vary [FormatJson, FormatText] + :: Vary [FormatJson, FormatText, FormatYaml] -> Maybe (File () Out) -> Map PoolId Rational -> ExceptT QueryCmdError IO () @@ -1472,6 +1483,7 @@ writeStakeDistribution format mOutFile stakeDistrib = do & ( id . Vary.on (\FormatJson -> Json.encodeJson stakeDistrib) . Vary.on (\FormatText -> strictTextToLazyBytestring stakeDistributionText) + . Vary.on (\FormatYaml -> Json.encodeYaml stakeDistrib) $ Vary.exhaustiveCase ) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/TextView/Command.hs b/cardano-cli/src/Cardano/CLI/EraBased/TextView/Command.hs index a714296ba6..a1b3162df8 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/TextView/Command.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/TextView/Command.hs @@ -10,7 +10,7 @@ where import Cardano.Api.Shelley -import Cardano.CLI.Type.Common (FormatCborHex, FormatText) +import Cardano.CLI.Type.Common (FormatCborHex, FormatJson, FormatText, FormatYaml) import Data.Text (Text) import Vary @@ -22,7 +22,7 @@ newtype TextViewCmds era data TextViewDecodeCborCmdArgs = TextViewDecodeCborCmdArgs { inputFile :: !FilePath - , outputFormat :: !(Vary [FormatCborHex, FormatText]) + , outputFormat :: !(Vary [FormatCborHex, FormatJson, FormatText, FormatYaml]) , mOutFile :: Maybe (File () Out) } deriving Show diff --git a/cardano-cli/src/Cardano/CLI/EraBased/TextView/Option.hs b/cardano-cli/src/Cardano/CLI/EraBased/TextView/Option.hs index 6a0c13e106..2673b7a8df 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/TextView/Option.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/TextView/Option.hs @@ -41,7 +41,9 @@ pTextViewCmds = <*> pFormatFlags "text view info output format" [ flagFormatCborHex + , flagFormatJson , flagFormatText & setDefault + , flagFormatYaml ] <*> pMaybeOutputFile ) diff --git a/cardano-cli/src/Cardano/CLI/EraBased/TextView/Run.hs b/cardano-cli/src/Cardano/CLI/EraBased/TextView/Run.hs index 2a3197b830..d6ca0a60f8 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/TextView/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/TextView/Run.hs @@ -14,6 +14,7 @@ import Cardano.Api import Cardano.CLI.EraBased.TextView.Command import Cardano.CLI.Helper (cborToText) +import Cardano.CLI.Json.Encode qualified as Json import Cardano.CLI.Type.Common import Cardano.CLI.Type.Error.TextViewFileError @@ -43,7 +44,9 @@ runTextViewInfoCmd outputFormat & ( id . Vary.on (\FormatCborHex -> pure lbCBOR) + . Vary.on (\FormatJson -> pure $ Json.encodeJson tv) . Vary.on (\FormatText -> LBS.fromStrict . Text.encodeUtf8 <$> cborToText lbCBOR) + . Vary.on (\FormatYaml -> pure $ Json.encodeYaml tv) $ Vary.exhaustiveCase ) & firstExceptT TextViewCBORPrettyPrintError diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Command.hs b/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Command.hs index 28e6976f18..9ce1712885 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Command.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Command.hs @@ -252,7 +252,7 @@ data TransactionCalculateMinFeeCmdArgs = TransactionCalculateMinFeeCmdArgs , txByronWitnessCount :: !TxByronWitnessCount , referenceScriptSize :: !ReferenceScriptSize -- ^ The total size in bytes of the transaction reference scripts. - , outputFormat :: !(Vary [FormatJson, FormatText]) + , outputFormat :: !(Vary [FormatJson, FormatText, FormatYaml]) , outFile :: !(Maybe (File () Out)) } deriving Show @@ -314,7 +314,7 @@ newtype TransactionHashScriptDataCmdArgs = TransactionHashScriptDataCmdArgs data TransactionTxIdCmdArgs = TransactionTxIdCmdArgs { inputTxBodyOrTxFile :: InputTxBodyOrTxFile - , outputFormat :: !(Vary [FormatJson, FormatText]) + , outputFormat :: !(Vary [FormatJson, FormatText, FormatYaml]) } deriving Show diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Option.hs b/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Option.hs index 8a3e628927..d5e983633d 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Option.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Option.hs @@ -387,6 +387,7 @@ pTransactionCalculateMinFee = "calculate-min-fee query output" [ flagFormatJson & setDefault , flagFormatText + , flagFormatYaml ] <*> optional pOutputFile -- Deprecated options: @@ -546,6 +547,7 @@ pTransactionId = "output" [ flagFormatJson & setDefault , flagFormatText + , flagFormatYaml ] pIsCborOutCanonical :: Parser TxCborFormat diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Run.hs b/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Run.hs index bfc603cb76..ddd5e96c54 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Run.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Transaction/Run.hs @@ -77,6 +77,7 @@ import Cardano.CLI.EraBased.Transaction.Internal.HashCheck , checkProposalHashes , checkVotingProcedureHashes ) +import Cardano.CLI.Json.Encode qualified as Json import Cardano.CLI.Orphan () import Cardano.CLI.Read import Cardano.CLI.Type.Common @@ -1530,16 +1531,18 @@ runTransactionCalculateMinFeeCmd let fee = shelleyfee + byronfee textToWrite = docToText $ pretty fee - jsonToWrite = encodePretty $ Aeson.object ["fee" .= fee] + content = Aeson.object ["fee" .= fee] outputFormat & ( id . Vary.on ( \FormatJson -> case outFile of Nothing -> - liftIO $ LBS.putStrLn jsonToWrite + liftIO $ LBS.putStrLn $ Json.encodeJson content Just file -> - firstExceptT TxCmdWriteFileError . newExceptT $ writeLazyByteStringFile file jsonToWrite + firstExceptT TxCmdWriteFileError . newExceptT $ + writeLazyByteStringFile file $ + Json.encodeJson content ) . Vary.on ( \FormatText -> case outFile of @@ -1548,6 +1551,15 @@ runTransactionCalculateMinFeeCmd Just file -> firstExceptT TxCmdWriteFileError . newExceptT $ writeTextFile file textToWrite ) + . Vary.on + ( \FormatYaml -> case outFile of + Nothing -> + liftIO $ LBS.putStrLn $ Json.encodeYaml content + Just file -> + firstExceptT TxCmdWriteFileError . newExceptT $ + writeLazyByteStringFile file $ + Json.encodeYaml content + ) $ Vary.exhaustiveCase ) @@ -1825,8 +1837,9 @@ runTransactionTxIdCmd liftIO $ outputFormat & ( id - . Vary.on (\FormatJson -> LBS.putStrLn $ Aeson.encode $ TxSubmissionResult txId) + . Vary.on (\FormatJson -> LBS.putStrLn $ Json.encodeJson $ TxSubmissionResult txId) . Vary.on (\FormatText -> BS.putStrLn $ serialiseToRawBytesHex txId) + . Vary.on (\FormatYaml -> LBS.putStrLn $ Json.encodeYaml $ TxSubmissionResult txId) $ Vary.exhaustiveCase ) diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli index 2c959dd939..98663d815c 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -313,7 +313,10 @@ Usage: cardano-cli query stake-pools [--cardano-mode [--epoch-slots SLOTS]] (--mainnet | --testnet-magic NATURAL) --socket-path SOCKET_PATH [--volatile-tip | --immutable-tip] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Get the node's current set of stake pool ids @@ -326,7 +329,10 @@ Usage: cardano-cli query stake-distribution ) --socket-path SOCKET_PATH [--volatile-tip | --immutable-tip] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Get the node's current aggregated stake distribution @@ -370,6 +376,7 @@ Usage: cardano-cli query utxo [--cardano-mode [--epoch-slots SLOTS]] | --output-cbor-hex | --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -379,7 +386,10 @@ Usage: cardano-cli query ledger-state [--cardano-mode [--epoch-slots SLOTS]] (--mainnet | --testnet-magic NATURAL) --socket-path SOCKET_PATH [--volatile-tip | --immutable-tip] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Dump the current ledger state of the node (Ledger.NewEpochState -- advanced @@ -1977,7 +1987,10 @@ Usage: cardano-cli conway query ledger-state [ --volatile-tip | --immutable-tip ] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Dump the current ledger state of the node (Ledger.NewEpochState -- advanced @@ -2096,6 +2109,7 @@ Usage: cardano-cli conway query ref-script-size (--tx-in TX_IN) [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -2168,6 +2182,7 @@ Usage: cardano-cli conway query stake-distribution ] [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -2181,7 +2196,10 @@ Usage: cardano-cli conway query stake-pools ) --socket-path SOCKET_PATH [--volatile-tip | --immutable-tip] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Get the node's current set of stake pool ids @@ -2280,6 +2298,7 @@ Usage: cardano-cli conway query utxo [--cardano-mode [--epoch-slots SLOTS]] | --output-cbor-hex | --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -2564,7 +2583,9 @@ Usage: cardano-cli conway text-view decode-cbor Usage: cardano-cli conway text-view decode-cbor --in-file FILEPATH [ --output-cbor-hex + | --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -3130,6 +3151,7 @@ Usage: cardano-cli conway transaction calculate-min-fee --tx-body-file FILEPATH [--reference-script-size NATURAL] [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] [ --mainnet @@ -3221,7 +3243,10 @@ Usage: cardano-cli conway transaction txid ( --tx-body-file FILEPATH | --tx-file FILEPATH ) - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] Print a transaction identifier. @@ -4259,7 +4284,10 @@ Usage: cardano-cli latest query ledger-state [ --volatile-tip | --immutable-tip ] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Dump the current ledger state of the node (Ledger.NewEpochState -- advanced @@ -4378,6 +4406,7 @@ Usage: cardano-cli latest query ref-script-size (--tx-in TX_IN) [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -4450,6 +4479,7 @@ Usage: cardano-cli latest query stake-distribution ] [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -4463,7 +4493,10 @@ Usage: cardano-cli latest query stake-pools ) --socket-path SOCKET_PATH [--volatile-tip | --immutable-tip] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Get the node's current set of stake pool ids @@ -4562,6 +4595,7 @@ Usage: cardano-cli latest query utxo [--cardano-mode [--epoch-slots SLOTS]] | --output-cbor-hex | --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -4846,7 +4880,9 @@ Usage: cardano-cli latest text-view decode-cbor Usage: cardano-cli latest text-view decode-cbor --in-file FILEPATH [ --output-cbor-hex + | --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -5412,6 +5448,7 @@ Usage: cardano-cli latest transaction calculate-min-fee --tx-body-file FILEPATH [--reference-script-size NATURAL] [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] [ --mainnet @@ -5503,7 +5540,10 @@ Usage: cardano-cli latest transaction txid ( --tx-body-file FILEPATH | --tx-file FILEPATH ) - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] Print a transaction identifier. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ledger-state.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ledger-state.cli index dd5b75a745..1b43201824 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ledger-state.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ledger-state.cli @@ -8,7 +8,10 @@ Usage: cardano-cli conway query ledger-state [ --volatile-tip | --immutable-tip ] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Dump the current ledger state of the node (Ledger.NewEpochState -- advanced @@ -33,5 +36,6 @@ Available options: --immutable-tip Use the immutable tip as a target. --output-json Format ledger-state query output to JSON (default). --output-text Format ledger-state query output to TEXT. + --output-yaml Format ledger-state query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ref-script-size.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ref-script-size.cli index 31228a618a..31b8d183e4 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ref-script-size.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_ref-script-size.cli @@ -11,6 +11,7 @@ Usage: cardano-cli conway query ref-script-size (--tx-in TX_IN) [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -38,5 +39,6 @@ Available options: --output-json Format reference-script-size query output to JSON (default). --output-text Format reference-script-size query output to TEXT. + --output-yaml Format reference-script-size query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_stake-distribution.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_stake-distribution.cli index 9fec83baa1..ae04a4d10a 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_stake-distribution.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_stake-distribution.cli @@ -10,6 +10,7 @@ Usage: cardano-cli conway query stake-distribution ] [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -35,5 +36,6 @@ Available options: --output-json Format stake-distribution query output to JSON (default). --output-text Format stake-distribution query output to TEXT. + --output-yaml Format stake-distribution query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_stake-pools.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_stake-pools.cli index 894f20ae87..056ecf721d 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_stake-pools.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_stake-pools.cli @@ -6,7 +6,10 @@ Usage: cardano-cli conway query stake-pools ) --socket-path SOCKET_PATH [--volatile-tip | --immutable-tip] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Get the node's current set of stake pool ids @@ -30,5 +33,6 @@ Available options: --immutable-tip Use the immutable tip as a target. --output-json Format stake-pools query output to JSON (default). --output-text Format stake-pools query output to TEXT. + --output-yaml Format stake-pools query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_utxo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_utxo.cli index 1116ed676e..a4db6d67a5 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_utxo.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_query_utxo.cli @@ -10,6 +10,7 @@ Usage: cardano-cli conway query utxo [--cardano-mode [--epoch-slots SLOTS]] | --output-cbor-hex | --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -40,5 +41,6 @@ Available options: --output-cbor-hex Format utxo query output to BASE16 CBOR. --output-json Format utxo query output to JSON (default). --output-text Format utxo query output to TEXT. + --output-yaml Format utxo query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_text-view_decode-cbor.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_text-view_decode-cbor.cli index de03c6f0e3..33adc90cf7 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_text-view_decode-cbor.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_text-view_decode-cbor.cli @@ -1,6 +1,8 @@ Usage: cardano-cli conway text-view decode-cbor --in-file FILEPATH [ --output-cbor-hex + | --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -9,7 +11,9 @@ Usage: cardano-cli conway text-view decode-cbor --in-file FILEPATH Available options: --in-file FILEPATH CBOR input file. --output-cbor-hex Format text view info output format to BASE16 CBOR. + --output-json Format text view info output format to JSON. --output-text Format text view info output format to TEXT (default). + --output-yaml Format text view info output format to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_calculate-min-fee.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_calculate-min-fee.cli index 7304518ea3..43994cae2d 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_calculate-min-fee.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_calculate-min-fee.cli @@ -5,6 +5,7 @@ Usage: cardano-cli conway transaction calculate-min-fee --tx-body-file FILEPATH [--reference-script-size NATURAL] [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] [ --mainnet @@ -28,6 +29,7 @@ Available options: --output-json Format calculate-min-fee query output to JSON (default). --output-text Format calculate-min-fee query output to TEXT. + --output-yaml Format calculate-min-fee query output to YAML. --out-file FILEPATH The output file. --mainnet DEPRECATED. This argument has no effect. --testnet-magic NATURAL DEPRECATED. This argument has no effect. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_txid.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_txid.cli index 742ef0cb37..e2f00167f0 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_txid.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_txid.cli @@ -2,7 +2,10 @@ Usage: cardano-cli conway transaction txid ( --tx-body-file FILEPATH | --tx-file FILEPATH ) - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] Print a transaction identifier. @@ -11,4 +14,5 @@ Available options: --tx-file FILEPATH Input filepath of the JSON Tx. --output-json Format output to JSON (default). --output-text Format output to TEXT. + --output-yaml Format output to YAML. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ledger-state.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ledger-state.cli index c04eab70f8..d6a712e960 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ledger-state.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ledger-state.cli @@ -8,7 +8,10 @@ Usage: cardano-cli latest query ledger-state [ --volatile-tip | --immutable-tip ] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Dump the current ledger state of the node (Ledger.NewEpochState -- advanced @@ -33,5 +36,6 @@ Available options: --immutable-tip Use the immutable tip as a target. --output-json Format ledger-state query output to JSON (default). --output-text Format ledger-state query output to TEXT. + --output-yaml Format ledger-state query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ref-script-size.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ref-script-size.cli index b60a6a2b5f..db9e3f4e1c 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ref-script-size.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_ref-script-size.cli @@ -11,6 +11,7 @@ Usage: cardano-cli latest query ref-script-size (--tx-in TX_IN) [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -38,5 +39,6 @@ Available options: --output-json Format reference-script-size query output to JSON (default). --output-text Format reference-script-size query output to TEXT. + --output-yaml Format reference-script-size query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_stake-distribution.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_stake-distribution.cli index 5bac92902d..20684412be 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_stake-distribution.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_stake-distribution.cli @@ -10,6 +10,7 @@ Usage: cardano-cli latest query stake-distribution ] [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -35,5 +36,6 @@ Available options: --output-json Format stake-distribution query output to JSON (default). --output-text Format stake-distribution query output to TEXT. + --output-yaml Format stake-distribution query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_stake-pools.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_stake-pools.cli index e353590ac0..a6c373b80b 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_stake-pools.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_stake-pools.cli @@ -6,7 +6,10 @@ Usage: cardano-cli latest query stake-pools ) --socket-path SOCKET_PATH [--volatile-tip | --immutable-tip] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Get the node's current set of stake pool ids @@ -30,5 +33,6 @@ Available options: --immutable-tip Use the immutable tip as a target. --output-json Format stake-pools query output to JSON (default). --output-text Format stake-pools query output to TEXT. + --output-yaml Format stake-pools query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_utxo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_utxo.cli index c3c165f9da..5429c862b8 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_utxo.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_query_utxo.cli @@ -10,6 +10,7 @@ Usage: cardano-cli latest query utxo [--cardano-mode [--epoch-slots SLOTS]] | --output-cbor-hex | --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -40,5 +41,6 @@ Available options: --output-cbor-hex Format utxo query output to BASE16 CBOR. --output-json Format utxo query output to JSON (default). --output-text Format utxo query output to TEXT. + --output-yaml Format utxo query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_text-view_decode-cbor.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_text-view_decode-cbor.cli index c1bb0224dd..42a89c1b90 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_text-view_decode-cbor.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_text-view_decode-cbor.cli @@ -1,6 +1,8 @@ Usage: cardano-cli latest text-view decode-cbor --in-file FILEPATH [ --output-cbor-hex + | --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -9,7 +11,9 @@ Usage: cardano-cli latest text-view decode-cbor --in-file FILEPATH Available options: --in-file FILEPATH CBOR input file. --output-cbor-hex Format text view info output format to BASE16 CBOR. + --output-json Format text view info output format to JSON. --output-text Format text view info output format to TEXT (default). + --output-yaml Format text view info output format to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_calculate-min-fee.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_calculate-min-fee.cli index f03f20c71b..8d12b190a7 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_calculate-min-fee.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_calculate-min-fee.cli @@ -5,6 +5,7 @@ Usage: cardano-cli latest transaction calculate-min-fee --tx-body-file FILEPATH [--reference-script-size NATURAL] [ --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] [ --mainnet @@ -28,6 +29,7 @@ Available options: --output-json Format calculate-min-fee query output to JSON (default). --output-text Format calculate-min-fee query output to TEXT. + --output-yaml Format calculate-min-fee query output to YAML. --out-file FILEPATH The output file. --mainnet DEPRECATED. This argument has no effect. --testnet-magic NATURAL DEPRECATED. This argument has no effect. diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_txid.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_txid.cli index ed57c7471e..3aa0157e5b 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_txid.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_txid.cli @@ -2,7 +2,10 @@ Usage: cardano-cli latest transaction txid ( --tx-body-file FILEPATH | --tx-file FILEPATH ) - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] Print a transaction identifier. @@ -11,4 +14,5 @@ Available options: --tx-file FILEPATH Input filepath of the JSON Tx. --output-json Format output to JSON (default). --output-text Format output to TEXT. + --output-yaml Format output to YAML. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/query_ledger-state.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/query_ledger-state.cli index 4d6f8cac99..0eeb89534a 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/query_ledger-state.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/query_ledger-state.cli @@ -2,7 +2,10 @@ Usage: cardano-cli query ledger-state [--cardano-mode [--epoch-slots SLOTS]] (--mainnet | --testnet-magic NATURAL) --socket-path SOCKET_PATH [--volatile-tip | --immutable-tip] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Dump the current ledger state of the node (Ledger.NewEpochState -- advanced @@ -27,5 +30,6 @@ Available options: --immutable-tip Use the immutable tip as a target. --output-json Format ledger-state query output to JSON (default). --output-text Format ledger-state query output to TEXT. + --output-yaml Format ledger-state query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/query_stake-distribution.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/query_stake-distribution.cli index 723564f89a..1782e15d46 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/query_stake-distribution.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/query_stake-distribution.cli @@ -6,7 +6,10 @@ Usage: cardano-cli query stake-distribution ) --socket-path SOCKET_PATH [--volatile-tip | --immutable-tip] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Get the node's current aggregated stake distribution @@ -31,5 +34,6 @@ Available options: --output-json Format stake-distribution query output to JSON (default). --output-text Format stake-distribution query output to TEXT. + --output-yaml Format stake-distribution query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/query_stake-pools.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/query_stake-pools.cli index f3c2f9d6e1..91228cd677 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/query_stake-pools.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/query_stake-pools.cli @@ -2,7 +2,10 @@ Usage: cardano-cli query stake-pools [--cardano-mode [--epoch-slots SLOTS]] (--mainnet | --testnet-magic NATURAL) --socket-path SOCKET_PATH [--volatile-tip | --immutable-tip] - [--output-json | --output-text] + [ --output-json + | --output-text + | --output-yaml + ] [--out-file FILEPATH] Get the node's current set of stake pool ids @@ -26,5 +29,6 @@ Available options: --immutable-tip Use the immutable tip as a target. --output-json Format stake-pools query output to JSON (default). --output-text Format stake-pools query output to TEXT. + --output-yaml Format stake-pools query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/query_utxo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/query_utxo.cli index 546d8abea3..7bb39b49f2 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/query_utxo.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/query_utxo.cli @@ -10,6 +10,7 @@ Usage: cardano-cli query utxo [--cardano-mode [--epoch-slots SLOTS]] | --output-cbor-hex | --output-json | --output-text + | --output-yaml ] [--out-file FILEPATH] @@ -40,5 +41,6 @@ Available options: --output-cbor-hex Format utxo query output to BASE16 CBOR. --output-json Format utxo query output to JSON (default). --output-text Format utxo query output to TEXT. + --output-yaml Format utxo query output to YAML. --out-file FILEPATH Optional output file. Default is to write to stdout. -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/shelley/transaction-id-default b/cardano-cli/test/cardano-cli-golden/files/golden/shelley/transaction-id-default index f0f491c300..c9c5e4db63 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/shelley/transaction-id-default +++ b/cardano-cli/test/cardano-cli-golden/files/golden/shelley/transaction-id-default @@ -1 +1,3 @@ -{"txhash":"345b88a38821ce10b1a19c41cbc9b48a55c26001cee4a7d2ad83fd9ddb157667"} +{ + "txhash": "345b88a38821ce10b1a19c41cbc9b48a55c26001cee4a7d2ad83fd9ddb157667" +} diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/shelley/transaction-id.json b/cardano-cli/test/cardano-cli-golden/files/golden/shelley/transaction-id.json index f0f491c300..c9c5e4db63 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/shelley/transaction-id.json +++ b/cardano-cli/test/cardano-cli-golden/files/golden/shelley/transaction-id.json @@ -1 +1,3 @@ -{"txhash":"345b88a38821ce10b1a19c41cbc9b48a55c26001cee4a7d2ad83fd9ddb157667"} +{ + "txhash": "345b88a38821ce10b1a19c41cbc9b48a55c26001cee4a7d2ad83fd9ddb157667" +}