From 6837a78b7c3f49f8bd238202443b62f308ed20f8 Mon Sep 17 00:00:00 2001 From: John Ky Date: Tue, 9 Apr 2024 22:09:30 +1000 Subject: [PATCH 1/2] New transaction echo command --- .../CLI/EraBased/Commands/Transaction.hs | 9 +++ .../CLI/EraBased/Options/Transaction.hs | 11 ++++ .../Cardano/CLI/EraBased/Run/Transaction.hs | 39 ++++++++++++ .../cardano-cli-golden/files/golden/help.cli | 60 +++++++++++++++++++ .../files/golden/help/allegra_transaction.cli | 2 + .../golden/help/allegra_transaction_echo.cli | 13 ++++ .../files/golden/help/alonzo_transaction.cli | 2 + .../golden/help/alonzo_transaction_echo.cli | 13 ++++ .../files/golden/help/babbage_transaction.cli | 2 + .../golden/help/babbage_transaction_echo.cli | 13 ++++ .../files/golden/help/conway_transaction.cli | 2 + .../golden/help/conway_transaction_echo.cli | 13 ++++ .../files/golden/help/latest_transaction.cli | 2 + .../golden/help/latest_transaction_echo.cli | 13 ++++ .../files/golden/help/mary_transaction.cli | 2 + .../golden/help/mary_transaction_echo.cli | 10 ++++ .../files/golden/help/shelley_transaction.cli | 2 + .../golden/help/shelley_transaction_echo.cli | 13 ++++ 18 files changed, 221 insertions(+) create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_echo.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_echo.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_echo.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_echo.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_echo.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_echo.cli create mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_echo.cli diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Transaction.hs index 0544d0c28e..807bf3789e 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Transaction.hs @@ -7,6 +7,7 @@ module Cardano.CLI.EraBased.Commands.Transaction , TransactionBuildRawCmdArgs (..) , TransactionBuildCmdArgs (..) , TransactionBuildEstimateCmdArgs (..) + , TransactionEchoCmdArgs (..) , TransactionSignCmdArgs (..) , TransactionWitnessCmdArgs (..) , TransactionSignWitnessCmdArgs (..) @@ -33,6 +34,7 @@ data TransactionCmds era = TransactionBuildRawCmd !(TransactionBuildRawCmdArgs era) | TransactionBuildCmd !(TransactionBuildCmdArgs era) | TransactionBuildEstimateCmd !(TransactionBuildEstimateCmdArgs era) + | TransactionEchoCmd !TransactionEchoCmdArgs | TransactionSignCmd !TransactionSignCmdArgs | TransactionWitnessCmd !TransactionWitnessCmdArgs | TransactionSignWitnessCmd !TransactionSignWitnessCmdArgs @@ -182,6 +184,12 @@ data TransactionBuildEstimateCmdArgs era = TransactionBuildEstimateCmdArgs , txBodyOutFile :: !(TxBodyFile Out) } +data TransactionEchoCmdArgs = TransactionEchoCmdArgs + { txOrTxBodyFile :: !InputTxBodyOrTxFile + , outTxFile :: !(TxFile Out) + } + deriving Show + data TransactionSignCmdArgs = TransactionSignCmdArgs { txOrTxBodyFile :: !InputTxBodyOrTxFile , witnessSigningData :: ![WitnessSigningData] @@ -259,6 +267,7 @@ renderTransactionCmds = \case TransactionBuildCmd{} -> "transaction build" TransactionBuildEstimateCmd{} -> "transaction build-estimate" TransactionBuildRawCmd{} -> "transaction build-raw" + TransactionEchoCmd{} -> "transaction echo" TransactionSignCmd{} -> "transaction sign" TransactionWitnessCmd{} -> "transaction witness" TransactionSignWitnessCmd{} -> "transaction sign-witness" diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs index a5d8a7c7d3..26ecf234ec 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs @@ -59,6 +59,10 @@ pTransactionCmds era envCli = subParser "sign" $ Opt.info (pTransactionSign envCli) $ Opt.progDesc "Sign a transaction" + , Just $ + subParser "echo" $ + Opt.info pTransactionEcho $ + Opt.progDesc "Echo a transaction" , Just $ subParser "witness" $ Opt.info (pTransactionCreateWitness envCli) $ @@ -307,6 +311,13 @@ pTransactionSign envCli = <*> optional (pNetworkId envCli) <*> pTxFileOut +pTransactionEcho :: Parser (TransactionCmds era) +pTransactionEcho = + fmap TransactionEchoCmd $ + TransactionEchoCmdArgs + <$> pInputTxOrTxBodyFile + <*> pTxFileOut + pTransactionCreateWitness :: EnvCli -> Parser (TransactionCmds era) pTransactionCreateWitness envCli = fmap TransactionWitnessCmd $ diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs index 3b7abb0430..1ab5f728da 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Run/Transaction.hs @@ -19,6 +19,7 @@ module Cardano.CLI.EraBased.Run.Transaction ( runTransactionCmds , runTransactionBuildCmd , runTransactionBuildRawCmd + , runTransactionEchoCmd , runTransactionSignCmd , runTransactionSubmitCmd , runTransactionCalculateMinFeeCmd @@ -85,6 +86,7 @@ runTransactionCmds = \case Cmd.TransactionBuildCmd args -> runTransactionBuildCmd args Cmd.TransactionBuildEstimateCmd args -> runTransactionBuildEstimateCmd args Cmd.TransactionBuildRawCmd args -> runTransactionBuildRawCmd args + Cmd.TransactionEchoCmd args -> runTransactionEchoCmd args Cmd.TransactionSignCmd args -> runTransactionSignCmd args Cmd.TransactionSubmitCmd args -> runTransactionSubmitCmd args Cmd.TransactionCalculateMinFeeCmd args -> runTransactionCalculateMinFeeCmd args @@ -1448,6 +1450,43 @@ runTransactionSignCmd lift (writeTxFileTextEnvelopeCddl sbe outTxFile tx) & onLeft (left . TxCmdWriteFileError) +-- ---------------------------------------------------------------------------- +-- Transaction echoing +-- + +runTransactionEchoCmd + :: () + => Cmd.TransactionEchoCmdArgs + -> ExceptT TxCmdError IO () +runTransactionEchoCmd + Cmd.TransactionEchoCmdArgs + { txOrTxBodyFile = txOrTxBody + , outTxFile = outTxFile + } = do + case txOrTxBody of + InputTxFile (File inputTxFilePath) -> do + inputTxFile <- liftIO $ fileOrPipe inputTxFilePath + anyTx <- lift (readFileTx inputTxFile) & onLeft (left . TxCmdTextEnvCddlError) + + InAnyShelleyBasedEra sbe tx <- pure anyTx + + lift (writeTxFileTextEnvelopeCddl sbe outTxFile tx) + & onLeft (left . TxCmdWriteFileError) + InputTxBodyFile (File txbodyFilePath) -> do + txbodyFile <- liftIO $ fileOrPipe txbodyFilePath + unwitnessed <- firstExceptT TxCmdTextEnvCddlError . newExceptT $ readFileTxBody txbodyFile + + case unwitnessed of + IncompleteCddlTxBody anyTxBody -> do + InAnyShelleyBasedEra sbe txbody <- pure anyTxBody + + let tx = makeSignedTransaction [] txbody + + firstExceptT TxCmdWriteFileError . newExceptT $ + writeLazyByteStringFile outTxFile $ + shelleyBasedEraConstraints sbe $ + textEnvelopeToJSON Nothing tx + -- ---------------------------------------------------------------------------- -- Transaction submission -- 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 2fe58598ba..653b021c68 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -825,6 +825,7 @@ Usage: cardano-cli shelley transaction ( build-raw | build | sign + | echo | witness | assemble | submit @@ -1103,6 +1104,14 @@ Usage: cardano-cli shelley transaction sign Sign a transaction +Usage: cardano-cli shelley transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + Usage: cardano-cli shelley transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -2024,6 +2033,7 @@ Usage: cardano-cli allegra transaction ( build-raw | build | sign + | echo | witness | assemble | submit @@ -2302,6 +2312,14 @@ Usage: cardano-cli allegra transaction sign Sign a transaction +Usage: cardano-cli allegra transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + Usage: cardano-cli allegra transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -3215,6 +3233,7 @@ Usage: cardano-cli mary transaction | build | build-estimate | sign + | echo | witness | assemble | submit @@ -3618,6 +3637,11 @@ Usage: cardano-cli mary transaction sign (--tx-body-file FILE | --tx-file FILE) Sign a transaction +Usage: cardano-cli mary transaction echo (--tx-body-file FILE | --tx-file FILE) + --out-file FILE + + Echo a transaction + Usage: cardano-cli mary transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -4541,6 +4565,7 @@ Usage: cardano-cli alonzo transaction | build | build-estimate | sign + | echo | witness | assemble | submit @@ -4951,6 +4976,14 @@ Usage: cardano-cli alonzo transaction sign Sign a transaction +Usage: cardano-cli alonzo transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + Usage: cardano-cli alonzo transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -5899,6 +5932,7 @@ Usage: cardano-cli babbage transaction | build | build-estimate | sign + | echo | witness | assemble | submit @@ -6309,6 +6343,14 @@ Usage: cardano-cli babbage transaction sign Sign a transaction +Usage: cardano-cli babbage transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + Usage: cardano-cli babbage transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -7686,6 +7728,7 @@ Usage: cardano-cli conway transaction | build | build-estimate | sign + | echo | witness | assemble | submit @@ -8142,6 +8185,14 @@ Usage: cardano-cli conway transaction sign Sign a transaction +Usage: cardano-cli conway transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + Usage: cardano-cli conway transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -9087,6 +9138,7 @@ Usage: cardano-cli latest transaction | build | build-estimate | sign + | echo | witness | assemble | submit @@ -9497,6 +9549,14 @@ Usage: cardano-cli latest transaction sign Sign a transaction +Usage: cardano-cli latest transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + Usage: cardano-cli latest transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction.cli index aedd2c5223..0dab120242 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction.cli @@ -2,6 +2,7 @@ Usage: cardano-cli allegra transaction ( build-raw | build | sign + | echo | witness | assemble | submit @@ -26,6 +27,7 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction + echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_echo.cli new file mode 100644 index 0000000000..894035cd90 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_echo.cli @@ -0,0 +1,13 @@ +Usage: cardano-cli allegra transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + +Available options: + --tx-body-file FILE Input filepath of the JSON TxBody. + --tx-file FILE Input filepath of the JSON Tx. + --out-file FILE Output filepath of the JSON Tx. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction.cli index f4069516e8..bcb0c24e6f 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction.cli @@ -3,6 +3,7 @@ Usage: cardano-cli alonzo transaction | build | build-estimate | sign + | echo | witness | assemble | submit @@ -30,6 +31,7 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction + echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_echo.cli new file mode 100644 index 0000000000..5eb209f41b --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_echo.cli @@ -0,0 +1,13 @@ +Usage: cardano-cli alonzo transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + +Available options: + --tx-body-file FILE Input filepath of the JSON TxBody. + --tx-file FILE Input filepath of the JSON Tx. + --out-file FILE Output filepath of the JSON Tx. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction.cli index d999ca5ec8..b3bb932ee1 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction.cli @@ -3,6 +3,7 @@ Usage: cardano-cli babbage transaction | build | build-estimate | sign + | echo | witness | assemble | submit @@ -30,6 +31,7 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction + echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_echo.cli new file mode 100644 index 0000000000..309a665c72 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_echo.cli @@ -0,0 +1,13 @@ +Usage: cardano-cli babbage transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + +Available options: + --tx-body-file FILE Input filepath of the JSON TxBody. + --tx-file FILE Input filepath of the JSON Tx. + --out-file FILE Output filepath of the JSON Tx. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction.cli index 44c0dd0abe..1944caffb5 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction.cli @@ -3,6 +3,7 @@ Usage: cardano-cli conway transaction | build | build-estimate | sign + | echo | witness | assemble | submit @@ -30,6 +31,7 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction + echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_echo.cli new file mode 100644 index 0000000000..3a7cfcd341 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_echo.cli @@ -0,0 +1,13 @@ +Usage: cardano-cli conway transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + +Available options: + --tx-body-file FILE Input filepath of the JSON TxBody. + --tx-file FILE Input filepath of the JSON Tx. + --out-file FILE Output filepath of the JSON Tx. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction.cli index b420a63295..dc1b470fb8 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction.cli @@ -3,6 +3,7 @@ Usage: cardano-cli latest transaction | build | build-estimate | sign + | echo | witness | assemble | submit @@ -30,6 +31,7 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction + echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_echo.cli new file mode 100644 index 0000000000..9557a2ba18 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_echo.cli @@ -0,0 +1,13 @@ +Usage: cardano-cli latest transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + +Available options: + --tx-body-file FILE Input filepath of the JSON TxBody. + --tx-file FILE Input filepath of the JSON Tx. + --out-file FILE Output filepath of the JSON Tx. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction.cli index 24bfb695aa..1d8b4aa4bd 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction.cli @@ -3,6 +3,7 @@ Usage: cardano-cli mary transaction | build | build-estimate | sign + | echo | witness | assemble | submit @@ -30,6 +31,7 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction + echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_echo.cli new file mode 100644 index 0000000000..ef5e7c3804 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_echo.cli @@ -0,0 +1,10 @@ +Usage: cardano-cli mary transaction echo (--tx-body-file FILE | --tx-file FILE) + --out-file FILE + + Echo a transaction + +Available options: + --tx-body-file FILE Input filepath of the JSON TxBody. + --tx-file FILE Input filepath of the JSON Tx. + --out-file FILE Output filepath of the JSON Tx. + -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction.cli index 56647438fb..a0d0c34495 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction.cli @@ -2,6 +2,7 @@ Usage: cardano-cli shelley transaction ( build-raw | build | sign + | echo | witness | assemble | submit @@ -26,6 +27,7 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction + echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_echo.cli new file mode 100644 index 0000000000..007ad713a4 --- /dev/null +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_echo.cli @@ -0,0 +1,13 @@ +Usage: cardano-cli shelley transaction echo + ( --tx-body-file FILE + | --tx-file FILE + ) + --out-file FILE + + Echo a transaction + +Available options: + --tx-body-file FILE Input filepath of the JSON TxBody. + --tx-file FILE Input filepath of the JSON Tx. + --out-file FILE Output filepath of the JSON Tx. + -h,--help Show this help text From 1bba1f5affd2e1481eaee7f13cbace704a080810 Mon Sep 17 00:00:00 2001 From: John Ky Date: Tue, 18 Jun 2024 23:31:01 +1000 Subject: [PATCH 2/2] Move transaction echo command to under 'debug' command group. --- cardano-cli/cardano-cli.cabal | 7 ++ cardano-cli/src/Cardano/CLI/Commands/Debug.hs | 4 +- .../Cardano/CLI/Commands/Debug/Transaction.hs | 9 +++ .../CLI/Commands/Debug/Transaction/Echo.hs | 17 +++++ .../CLI/EraBased/Commands/Transaction.hs | 7 +- .../CLI/EraBased/Options/Transaction.hs | 11 --- .../Cardano/CLI/Options/Debug/Transaction.hs | 73 +++++++++++++++++++ .../CLI/Options/Debug/Transaction/Echo.hs | 22 ++++++ cardano-cli/src/Cardano/CLI/Run/Debug.hs | 22 ++++-- .../src/Cardano/CLI/Run/Debug/Transaction.hs | 18 +++++ .../Cardano/CLI/Run/Debug/Transaction/Echo.hs | 51 +++++++++++++ .../Cardano/CLI/Types/Errors/DebugCmdError.hs | 17 +++++ .../cardano-cli-golden/files/golden/help.cli | 60 --------------- .../files/golden/help/allegra_transaction.cli | 2 - .../golden/help/allegra_transaction_echo.cli | 13 ---- .../files/golden/help/alonzo_transaction.cli | 2 - .../golden/help/alonzo_transaction_echo.cli | 13 ---- .../files/golden/help/babbage_transaction.cli | 2 - .../golden/help/babbage_transaction_echo.cli | 13 ---- .../files/golden/help/conway_transaction.cli | 2 - .../golden/help/conway_transaction_echo.cli | 13 ---- .../files/golden/help/latest_transaction.cli | 2 - .../golden/help/latest_transaction_echo.cli | 13 ---- .../files/golden/help/mary_transaction.cli | 2 - .../golden/help/mary_transaction_echo.cli | 10 --- .../files/golden/help/shelley_transaction.cli | 2 - .../golden/help/shelley_transaction_echo.cli | 13 ---- 27 files changed, 233 insertions(+), 187 deletions(-) create mode 100644 cardano-cli/src/Cardano/CLI/Commands/Debug/Transaction.hs create mode 100644 cardano-cli/src/Cardano/CLI/Commands/Debug/Transaction/Echo.hs create mode 100644 cardano-cli/src/Cardano/CLI/Options/Debug/Transaction.hs create mode 100644 cardano-cli/src/Cardano/CLI/Options/Debug/Transaction/Echo.hs create mode 100644 cardano-cli/src/Cardano/CLI/Run/Debug/Transaction.hs create mode 100644 cardano-cli/src/Cardano/CLI/Run/Debug/Transaction/Echo.hs create mode 100644 cardano-cli/src/Cardano/CLI/Types/Errors/DebugCmdError.hs delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_echo.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_echo.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_echo.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_echo.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_echo.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_echo.cli delete mode 100644 cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_echo.cli diff --git a/cardano-cli/cardano-cli.cabal b/cardano-cli/cardano-cli.cabal index b2fbad862a..86200186bf 100644 --- a/cardano-cli/cardano-cli.cabal +++ b/cardano-cli/cardano-cli.cabal @@ -60,6 +60,8 @@ library Cardano.CLI.Commands Cardano.CLI.Commands.Debug Cardano.CLI.Commands.Debug.LogEpochState + Cardano.CLI.Commands.Debug.Transaction + Cardano.CLI.Commands.Debug.Transaction.Echo Cardano.CLI.Commands.Hash Cardano.CLI.Commands.Ping Cardano.CLI.Environment @@ -145,6 +147,8 @@ library Cardano.CLI.OS.Posix Cardano.CLI.Options Cardano.CLI.Options.Debug + Cardano.CLI.Options.Debug.Transaction + Cardano.CLI.Options.Debug.Transaction.Echo Cardano.CLI.Options.Hash Cardano.CLI.Options.Ping Cardano.CLI.Orphans @@ -155,6 +159,8 @@ library Cardano.CLI.Run Cardano.CLI.Run.Debug Cardano.CLI.Run.Debug.LogEpochState + Cardano.CLI.Run.Debug.Transaction + Cardano.CLI.Run.Debug.Transaction.Echo Cardano.CLI.Run.Hash Cardano.CLI.Run.Ping Cardano.CLI.TopHandler @@ -164,6 +170,7 @@ library Cardano.CLI.Types.Errors.BootstrapWitnessError Cardano.CLI.Types.Errors.CardanoAddressSigningKeyConversionError Cardano.CLI.Types.Errors.CmdError + Cardano.CLI.Types.Errors.DebugCmdError Cardano.CLI.Types.Errors.DelegationError Cardano.CLI.Types.Errors.GenesisCmdError Cardano.CLI.Types.Errors.GovernanceActionsError diff --git a/cardano-cli/src/Cardano/CLI/Commands/Debug.hs b/cardano-cli/src/Cardano/CLI/Commands/Debug.hs index 8ab05d92b9..2e5928d545 100644 --- a/cardano-cli/src/Cardano/CLI/Commands/Debug.hs +++ b/cardano-cli/src/Cardano/CLI/Commands/Debug.hs @@ -4,6 +4,8 @@ module Cardano.CLI.Commands.Debug where import Cardano.CLI.Commands.Debug.LogEpochState +import Cardano.CLI.Commands.Debug.Transaction -newtype DebugCmds +data DebugCmds = DebugLogEpochStateCmd LogEpochStateCmdArgs + | DebugTransactionCmds DebugTransactionCmds diff --git a/cardano-cli/src/Cardano/CLI/Commands/Debug/Transaction.hs b/cardano-cli/src/Cardano/CLI/Commands/Debug/Transaction.hs new file mode 100644 index 0000000000..0fa0d0d5c9 --- /dev/null +++ b/cardano-cli/src/Cardano/CLI/Commands/Debug/Transaction.hs @@ -0,0 +1,9 @@ +module Cardano.CLI.Commands.Debug.Transaction + ( DebugTransactionCmds (..) + ) +where + +import Cardano.CLI.Commands.Debug.Transaction.Echo + +newtype DebugTransactionCmds + = DebugTransactionEchoCmd TransactionEchoCmdArgs diff --git a/cardano-cli/src/Cardano/CLI/Commands/Debug/Transaction/Echo.hs b/cardano-cli/src/Cardano/CLI/Commands/Debug/Transaction/Echo.hs new file mode 100644 index 0000000000..db47b9d3cb --- /dev/null +++ b/cardano-cli/src/Cardano/CLI/Commands/Debug/Transaction/Echo.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DuplicateRecordFields #-} + +module Cardano.CLI.Commands.Debug.Transaction.Echo + ( TransactionEchoCmdArgs (..) + ) +where + +import Cardano.Api.Shelley + +import Cardano.CLI.Types.Common + +data TransactionEchoCmdArgs = TransactionEchoCmdArgs + { txOrTxBodyFile :: !InputTxBodyOrTxFile + , outTxFile :: !(TxFile Out) + } + deriving Show diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Transaction.hs index 807bf3789e..92fd884d98 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Commands/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Commands/Transaction.hs @@ -25,6 +25,7 @@ where import Cardano.Api.Ledger (Coin) import Cardano.Api.Shelley +import Cardano.CLI.Commands.Debug.Transaction.Echo import Cardano.CLI.Types.Common import Cardano.CLI.Types.Governance @@ -184,12 +185,6 @@ data TransactionBuildEstimateCmdArgs era = TransactionBuildEstimateCmdArgs , txBodyOutFile :: !(TxBodyFile Out) } -data TransactionEchoCmdArgs = TransactionEchoCmdArgs - { txOrTxBodyFile :: !InputTxBodyOrTxFile - , outTxFile :: !(TxFile Out) - } - deriving Show - data TransactionSignCmdArgs = TransactionSignCmdArgs { txOrTxBodyFile :: !InputTxBodyOrTxFile , witnessSigningData :: ![WitnessSigningData] diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs index 26ecf234ec..a5d8a7c7d3 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Transaction.hs @@ -59,10 +59,6 @@ pTransactionCmds era envCli = subParser "sign" $ Opt.info (pTransactionSign envCli) $ Opt.progDesc "Sign a transaction" - , Just $ - subParser "echo" $ - Opt.info pTransactionEcho $ - Opt.progDesc "Echo a transaction" , Just $ subParser "witness" $ Opt.info (pTransactionCreateWitness envCli) $ @@ -311,13 +307,6 @@ pTransactionSign envCli = <*> optional (pNetworkId envCli) <*> pTxFileOut -pTransactionEcho :: Parser (TransactionCmds era) -pTransactionEcho = - fmap TransactionEchoCmd $ - TransactionEchoCmdArgs - <$> pInputTxOrTxBodyFile - <*> pTxFileOut - pTransactionCreateWitness :: EnvCli -> Parser (TransactionCmds era) pTransactionCreateWitness envCli = fmap TransactionWitnessCmd $ diff --git a/cardano-cli/src/Cardano/CLI/Options/Debug/Transaction.hs b/cardano-cli/src/Cardano/CLI/Options/Debug/Transaction.hs new file mode 100644 index 0000000000..70c5b2946d --- /dev/null +++ b/cardano-cli/src/Cardano/CLI/Options/Debug/Transaction.hs @@ -0,0 +1,73 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE ScopedTypeVariables #-} + +{- HLINT ignore "Use <$>" -} +{- HLINT ignore "Move brackets to avoid $" -} + +module Cardano.CLI.Options.Debug.Transaction + ( parseDebugCmds + ) +where + +import Cardano.Api.Shelley hiding (QueryInShelleyBasedEra (..)) + +import Cardano.CLI.Commands.Debug +import Cardano.CLI.Commands.Debug.LogEpochState +import Cardano.CLI.Environment +import Cardano.CLI.EraBased.Options.Common +import Cardano.CLI.Options.Debug.Transaction.Echo + +import Data.Foldable +import Options.Applicative hiding (help, str) +import qualified Options.Applicative as Opt + +parseDebugCmds :: EnvCli -> Parser DebugCmds +parseDebugCmds envCli = + Opt.hsubparser $ + mconcat + [ Opt.metavar "debug transaction commands" + , Opt.commandGroup "debug commands" + , Opt.command "transaction" $ + Opt.info (pDebugCmds envCli) $ + Opt.progDesc "Debug transaction commands" + ] + +pDebugCmds :: EnvCli -> Parser DebugCmds +pDebugCmds envCli = + asum + [ subParser "log-epoch-state" $ + Opt.info pLogEpochStateCmdArgs $ + Opt.progDesc $ + mconcat + [ "Log epoch state of a running node." + , " This command will connect to a local node and log the epoch state to a file." + , " The log file format is line delimited JSON." + , " The command will not terminate." + ] + , subParser "echo" $ + Opt.info (DebugTransactionCmds <$> pDebugTransactionEcho) $ + Opt.progDesc "Echo a transaction" + ] + where + pLogEpochStateCmdArgs :: Parser DebugCmds + pLogEpochStateCmdArgs = + fmap DebugLogEpochStateCmd $ + LogEpochStateCmdArgs + <$> pSocketPath envCli + <*> pNodeConfigurationFileIn + <*> pFileOutDirection + "out-file" + "Output filepath of the log file. The log file format is line delimited JSON." + +pNodeConfigurationFileIn :: Parser (NodeConfigFile In) +pNodeConfigurationFileIn = + fmap File $ + Opt.strOption $ + mconcat + [ Opt.long "node-configuration-file" + , Opt.metavar "FILE" + , Opt.help "Input filepath of the node configuration file." + , Opt.completer (Opt.bashCompleter "file") + ] diff --git a/cardano-cli/src/Cardano/CLI/Options/Debug/Transaction/Echo.hs b/cardano-cli/src/Cardano/CLI/Options/Debug/Transaction/Echo.hs new file mode 100644 index 0000000000..0a02059a04 --- /dev/null +++ b/cardano-cli/src/Cardano/CLI/Options/Debug/Transaction/Echo.hs @@ -0,0 +1,22 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module Cardano.CLI.Options.Debug.Transaction.Echo + ( pDebugTransactionEcho + ) +where + +import Cardano.CLI.Commands.Debug.Transaction +import Cardano.CLI.Commands.Debug.Transaction.Echo +import Cardano.CLI.EraBased.Options.Common + +import Options.Applicative hiding (help, str) + +pDebugTransactionEcho :: Parser DebugTransactionCmds +pDebugTransactionEcho = + fmap DebugTransactionEchoCmd $ + TransactionEchoCmdArgs + <$> pInputTxOrTxBodyFile + <*> pTxFileOut diff --git a/cardano-cli/src/Cardano/CLI/Run/Debug.hs b/cardano-cli/src/Cardano/CLI/Run/Debug.hs index 3b45f9243a..e74dd3afb1 100644 --- a/cardano-cli/src/Cardano/CLI/Run/Debug.hs +++ b/cardano-cli/src/Cardano/CLI/Run/Debug.hs @@ -8,18 +8,26 @@ module Cardano.CLI.Run.Debug ) where +import Cardano.Api + import Cardano.CLI.Commands.Debug import Cardano.CLI.Run.Debug.LogEpochState - -import Control.Monad.IO.Class -import Control.Monad.Trans.Except -import Prettyprinter - -data DebugCmdError = DebugCmdFailed +import Cardano.CLI.Run.Debug.Transaction +import Cardano.CLI.Types.Errors.DebugCmdError runDebugCmds :: DebugCmds -> ExceptT DebugCmdError IO () runDebugCmds = \case DebugLogEpochStateCmd cmd -> liftIO $ runLogEpochStateCmd cmd + DebugTransactionCmds cmds -> runDebugTransactionCmds cmds renderDebugCmdError :: DebugCmdError -> Doc ann -renderDebugCmdError DebugCmdFailed = "Debug command failed" +renderDebugCmdError = \case + DebugCmdFailed -> + "Debug command failed" + DebugCmdWriteFileError fileErr -> + prettyError fileErr + DebugCmdTextEnvCddlError cddlErr -> + mconcat + [ "Failed to decode the ledger's CDDL serialisation format. " + , "TextEnvelopeCddl error: " <> prettyError cddlErr + ] diff --git a/cardano-cli/src/Cardano/CLI/Run/Debug/Transaction.hs b/cardano-cli/src/Cardano/CLI/Run/Debug/Transaction.hs new file mode 100644 index 0000000000..df6fb46f83 --- /dev/null +++ b/cardano-cli/src/Cardano/CLI/Run/Debug/Transaction.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE LambdaCase #-} + +module Cardano.CLI.Run.Debug.Transaction + ( runDebugTransactionCmds + ) +where + +import Cardano.Api + +import Cardano.CLI.Commands.Debug.Transaction +import Cardano.CLI.Run.Debug.Transaction.Echo +import Cardano.CLI.Types.Errors.DebugCmdError + +runDebugTransactionCmds + :: DebugTransactionCmds + -> ExceptT DebugCmdError IO () +runDebugTransactionCmds = \case + DebugTransactionEchoCmd cmd -> runDebugTransactionEchoCmd cmd diff --git a/cardano-cli/src/Cardano/CLI/Run/Debug/Transaction/Echo.hs b/cardano-cli/src/Cardano/CLI/Run/Debug/Transaction/Echo.hs new file mode 100644 index 0000000000..a652e63263 --- /dev/null +++ b/cardano-cli/src/Cardano/CLI/Run/Debug/Transaction/Echo.hs @@ -0,0 +1,51 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DuplicateRecordFields #-} +{-# LANGUAGE ScopedTypeVariables #-} + +module Cardano.CLI.Run.Debug.Transaction.Echo + ( runDebugTransactionEchoCmd + ) +where + +import Cardano.Api + +import qualified Cardano.CLI.Commands.Debug.Transaction.Echo as Cmd +import Cardano.CLI.Orphans () +import Cardano.CLI.Read +import Cardano.CLI.Types.Common +import Cardano.CLI.Types.Errors.DebugCmdError + +import Data.Function ((&)) + +runDebugTransactionEchoCmd + :: () + => Cmd.TransactionEchoCmdArgs + -> ExceptT DebugCmdError IO () +runDebugTransactionEchoCmd + Cmd.TransactionEchoCmdArgs + { Cmd.txOrTxBodyFile = txOrTxBody + , Cmd.outTxFile = outTxFile + } = do + case txOrTxBody of + InputTxFile (File inputTxFilePath) -> do + inputTxFile <- liftIO $ fileOrPipe inputTxFilePath + anyTx <- lift (readFileTx inputTxFile) & onLeft (left . DebugCmdTextEnvCddlError) + + InAnyShelleyBasedEra sbe tx <- pure anyTx + + lift (writeTxFileTextEnvelopeCddl sbe outTxFile tx) + & onLeft (left . DebugCmdWriteFileError) + InputTxBodyFile (File txbodyFilePath) -> do + txbodyFile <- liftIO $ fileOrPipe txbodyFilePath + unwitnessed <- firstExceptT DebugCmdTextEnvCddlError . newExceptT $ readFileTxBody txbodyFile + + case unwitnessed of + IncompleteCddlTxBody anyTxBody -> do + InAnyShelleyBasedEra sbe txbody <- pure anyTxBody + + let tx = makeSignedTransaction [] txbody + + firstExceptT DebugCmdWriteFileError . newExceptT $ + writeLazyByteStringFile outTxFile $ + shelleyBasedEraConstraints sbe $ + textEnvelopeToJSON Nothing tx diff --git a/cardano-cli/src/Cardano/CLI/Types/Errors/DebugCmdError.hs b/cardano-cli/src/Cardano/CLI/Types/Errors/DebugCmdError.hs new file mode 100644 index 0000000000..f602cb3796 --- /dev/null +++ b/cardano-cli/src/Cardano/CLI/Types/Errors/DebugCmdError.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE GADTs #-} + +module Cardano.CLI.Types.Errors.DebugCmdError + ( DebugCmdError (..) + ) +where + +import Cardano.Api + +import GHC.Generics (Generic) + +data DebugCmdError + = DebugCmdFailed + | DebugCmdTextEnvCddlError !(FileError TextEnvelopeCddlError) + | DebugCmdWriteFileError !(FileError ()) + deriving (Show, Generic) 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 653b021c68..2fe58598ba 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help.cli @@ -825,7 +825,6 @@ Usage: cardano-cli shelley transaction ( build-raw | build | sign - | echo | witness | assemble | submit @@ -1104,14 +1103,6 @@ Usage: cardano-cli shelley transaction sign Sign a transaction -Usage: cardano-cli shelley transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - Usage: cardano-cli shelley transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -2033,7 +2024,6 @@ Usage: cardano-cli allegra transaction ( build-raw | build | sign - | echo | witness | assemble | submit @@ -2312,14 +2302,6 @@ Usage: cardano-cli allegra transaction sign Sign a transaction -Usage: cardano-cli allegra transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - Usage: cardano-cli allegra transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -3233,7 +3215,6 @@ Usage: cardano-cli mary transaction | build | build-estimate | sign - | echo | witness | assemble | submit @@ -3637,11 +3618,6 @@ Usage: cardano-cli mary transaction sign (--tx-body-file FILE | --tx-file FILE) Sign a transaction -Usage: cardano-cli mary transaction echo (--tx-body-file FILE | --tx-file FILE) - --out-file FILE - - Echo a transaction - Usage: cardano-cli mary transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -4565,7 +4541,6 @@ Usage: cardano-cli alonzo transaction | build | build-estimate | sign - | echo | witness | assemble | submit @@ -4976,14 +4951,6 @@ Usage: cardano-cli alonzo transaction sign Sign a transaction -Usage: cardano-cli alonzo transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - Usage: cardano-cli alonzo transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -5932,7 +5899,6 @@ Usage: cardano-cli babbage transaction | build | build-estimate | sign - | echo | witness | assemble | submit @@ -6343,14 +6309,6 @@ Usage: cardano-cli babbage transaction sign Sign a transaction -Usage: cardano-cli babbage transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - Usage: cardano-cli babbage transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -7728,7 +7686,6 @@ Usage: cardano-cli conway transaction | build | build-estimate | sign - | echo | witness | assemble | submit @@ -8185,14 +8142,6 @@ Usage: cardano-cli conway transaction sign Sign a transaction -Usage: cardano-cli conway transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - Usage: cardano-cli conway transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] @@ -9138,7 +9087,6 @@ Usage: cardano-cli latest transaction | build | build-estimate | sign - | echo | witness | assemble | submit @@ -9549,14 +9497,6 @@ Usage: cardano-cli latest transaction sign Sign a transaction -Usage: cardano-cli latest transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - Usage: cardano-cli latest transaction witness --tx-body-file FILE --signing-key-file FILE [--address STRING] diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction.cli index 0dab120242..aedd2c5223 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction.cli @@ -2,7 +2,6 @@ Usage: cardano-cli allegra transaction ( build-raw | build | sign - | echo | witness | assemble | submit @@ -27,7 +26,6 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction - echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_echo.cli deleted file mode 100644 index 894035cd90..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/allegra_transaction_echo.cli +++ /dev/null @@ -1,13 +0,0 @@ -Usage: cardano-cli allegra transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - -Available options: - --tx-body-file FILE Input filepath of the JSON TxBody. - --tx-file FILE Input filepath of the JSON Tx. - --out-file FILE Output filepath of the JSON Tx. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction.cli index bcb0c24e6f..f4069516e8 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction.cli @@ -3,7 +3,6 @@ Usage: cardano-cli alonzo transaction | build | build-estimate | sign - | echo | witness | assemble | submit @@ -31,7 +30,6 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction - echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_echo.cli deleted file mode 100644 index 5eb209f41b..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/alonzo_transaction_echo.cli +++ /dev/null @@ -1,13 +0,0 @@ -Usage: cardano-cli alonzo transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - -Available options: - --tx-body-file FILE Input filepath of the JSON TxBody. - --tx-file FILE Input filepath of the JSON Tx. - --out-file FILE Output filepath of the JSON Tx. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction.cli index b3bb932ee1..d999ca5ec8 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction.cli @@ -3,7 +3,6 @@ Usage: cardano-cli babbage transaction | build | build-estimate | sign - | echo | witness | assemble | submit @@ -31,7 +30,6 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction - echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_echo.cli deleted file mode 100644 index 309a665c72..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/babbage_transaction_echo.cli +++ /dev/null @@ -1,13 +0,0 @@ -Usage: cardano-cli babbage transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - -Available options: - --tx-body-file FILE Input filepath of the JSON TxBody. - --tx-file FILE Input filepath of the JSON Tx. - --out-file FILE Output filepath of the JSON Tx. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction.cli index 1944caffb5..44c0dd0abe 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction.cli @@ -3,7 +3,6 @@ Usage: cardano-cli conway transaction | build | build-estimate | sign - | echo | witness | assemble | submit @@ -31,7 +30,6 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction - echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_echo.cli deleted file mode 100644 index 3a7cfcd341..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/conway_transaction_echo.cli +++ /dev/null @@ -1,13 +0,0 @@ -Usage: cardano-cli conway transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - -Available options: - --tx-body-file FILE Input filepath of the JSON TxBody. - --tx-file FILE Input filepath of the JSON Tx. - --out-file FILE Output filepath of the JSON Tx. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction.cli index dc1b470fb8..b420a63295 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction.cli @@ -3,7 +3,6 @@ Usage: cardano-cli latest transaction | build | build-estimate | sign - | echo | witness | assemble | submit @@ -31,7 +30,6 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction - echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_echo.cli deleted file mode 100644 index 9557a2ba18..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/latest_transaction_echo.cli +++ /dev/null @@ -1,13 +0,0 @@ -Usage: cardano-cli latest transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - -Available options: - --tx-body-file FILE Input filepath of the JSON TxBody. - --tx-file FILE Input filepath of the JSON Tx. - --out-file FILE Output filepath of the JSON Tx. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction.cli index 1d8b4aa4bd..24bfb695aa 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction.cli @@ -3,7 +3,6 @@ Usage: cardano-cli mary transaction | build | build-estimate | sign - | echo | witness | assemble | submit @@ -31,7 +30,6 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction - echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_echo.cli deleted file mode 100644 index ef5e7c3804..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/mary_transaction_echo.cli +++ /dev/null @@ -1,10 +0,0 @@ -Usage: cardano-cli mary transaction echo (--tx-body-file FILE | --tx-file FILE) - --out-file FILE - - Echo a transaction - -Available options: - --tx-body-file FILE Input filepath of the JSON TxBody. - --tx-file FILE Input filepath of the JSON Tx. - --out-file FILE Output filepath of the JSON Tx. - -h,--help Show this help text diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction.cli index a0d0c34495..56647438fb 100644 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction.cli +++ b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction.cli @@ -2,7 +2,6 @@ Usage: cardano-cli shelley transaction ( build-raw | build | sign - | echo | witness | assemble | submit @@ -27,7 +26,6 @@ Available commands: Please note the order[93;22;23;24m of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.[0;22;23;24m sign Sign a transaction - echo Echo a transaction witness Create a transaction witness assemble Assemble a tx body and witness(es) to form a transaction diff --git a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_echo.cli b/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_echo.cli deleted file mode 100644 index 007ad713a4..0000000000 --- a/cardano-cli/test/cardano-cli-golden/files/golden/help/shelley_transaction_echo.cli +++ /dev/null @@ -1,13 +0,0 @@ -Usage: cardano-cli shelley transaction echo - ( --tx-body-file FILE - | --tx-file FILE - ) - --out-file FILE - - Echo a transaction - -Available options: - --tx-body-file FILE Input filepath of the JSON TxBody. - --tx-file FILE Input filepath of the JSON Tx. - --out-file FILE Output filepath of the JSON Tx. - -h,--help Show this help text