diff --git a/cardano-cli/ChangeLog.md b/cardano-cli/ChangeLog.md index d22d81b7439..32bc9917ae0 100644 --- a/cardano-cli/ChangeLog.md +++ b/cardano-cli/ChangeLog.md @@ -7,7 +7,9 @@ - Allow reading and writing text envelope files from pipes([PR4384](https://github.com/input-output-hk/cardano-node/pull/4384)) - Update cardano transaction view command to render inline datums and reference inputs ([PR4089](https://github.com/input-output-hk/cardano-node/pull/4089)) - Switch default era in cardano-cli from Alonzo to Babbage ([PR4485](https://github.com/input-output-hk/cardano-node/pull/4485)) -- Default to the ledger's CDDL format for transaction body creation by removing flags `--cddl-format` and `--cli-format` from `build` and `build-raw` ([PR 4303](https://github.com/input-output-hk/cardano-node/pull/4303)) +- For the `build` and `build-raw` commands, always use ledger's CDDL format for transaction body creation. + Remove the `cli-format` flag and make `--cddl-format` deprecated and hidden + ([PR 4303](https://github.com/input-output-hk/cardano-node/pull/4303) [PR 4617](https://github.com/input-output-hk/cardano-node/pull/4617)) - Allow reading signing keys from a pipe ([PR 4342](https://github.com/input-output-hk/cardano-node/pull/4342)) ## 1.35.3 -- August 2022 diff --git a/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs b/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs index 31b835383d7..f9a329e01ac 100644 --- a/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs +++ b/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs @@ -718,6 +718,7 @@ pTransaction = <*> many pMetadataFile <*> optional pProtocolParamsSourceSpec <*> optional pUpdateProposalFile + <* pOutputSerialisation -- TODO delete in the next release after 1.35.4 <*> (OutputTxBodyOnly <$> pTxBodyFile Output <|> pCalculatePlutusScriptCost) pChangeAddress :: Parser TxOutChangeAddress @@ -754,6 +755,7 @@ pTransaction = <*> many pMetadataFile <*> optional pProtocolParamsSourceSpec <*> optional pUpdateProposalFile + <* pOutputSerialisation -- TODO delete in the next release after 1.35.4 <*> pTxBodyFile Output pTransactionSign :: Parser TransactionCmd @@ -1754,6 +1756,15 @@ pOutputFormat = <> Opt.value OutputFormatBech32 ) +pOutputSerialisation :: Parser (Maybe ()) +pOutputSerialisation = + optional $ + Opt.flag () () + ( Opt.long "cddl-format" + <> Opt.help "Serialise in the ledger CDDL specified CBOR format." + <> Opt.hidden + ) + pMaybeOutputFile :: Parser (Maybe OutputFile) pMaybeOutputFile = optional $ diff --git a/cardano-cli/test/Test/Golden/Shelley/TextEnvelope/Tx/Tx.hs b/cardano-cli/test/Test/Golden/Shelley/TextEnvelope/Tx/Tx.hs index 9e00db87dab..866c041d284 100644 --- a/cardano-cli/test/Test/Golden/Shelley/TextEnvelope/Tx/Tx.hs +++ b/cardano-cli/test/Test/Golden/Shelley/TextEnvelope/Tx/Tx.hs @@ -38,6 +38,21 @@ golden_shelleyTx = propertyOnce . H.moduleWorkspace "tmp" $ \tempDir -> do , "--out-file", transactionBodyFile ] + -- TODO delete in the next release after 1.35.4 + -- Create transaction body in the same manner as the previous command but ensure that the --cddl-format + -- option is accepted. This transaction body file is unused in the test. + transactionBodyFile2 <- noteTempFile tempDir "tx-body-file" + void $ execCardanoCLI + [ "transaction", "build-raw" + , "--alonzo-era" + , "--tx-in", "f62cd7bc15d8c6d2c8519fb8d13c57c0157ab6bab50af62bc63706feb966393d#0" + , "--tx-out", "addr_test1qpmxr8d8jcl25kyz2tz9a9sxv7jxglhddyf475045y8j3zxjcg9vquzkljyfn3rasfwwlkwu7hhm59gzxmsyxf3w9dps8832xh+1199989833223" + , "--tx-out", "addr_test1vpqgspvmh6m2m5pwangvdg499srfzre2dd96qq57nlnw6yctpasy4+10000000" + , "--fee", "166777" + , "--cddl-format" + , "--out-file", transactionBodyFile2 + ] + -- Sign transaction void $ execCardanoCLI [ "transaction", "sign" diff --git a/cardano-testnet/test/Spec/Cli/KesPeriodInfo.hs b/cardano-testnet/test/Spec/Cli/KesPeriodInfo.hs index 0df3aa7dd87..19839852bb4 100644 --- a/cardano-testnet/test/Spec/Cli/KesPeriodInfo.hs +++ b/cardano-testnet/test/Spec/Cli/KesPeriodInfo.hs @@ -172,6 +172,23 @@ hprop_kes_period_info = H.integration . H.runFinallies . H.workspace "chairman" , "--out-file", work "pledge-registration-cert.txbody" ] + -- TODO delete in the next release after 1.35.4 + -- Create transaction body in the same manner as the previous command but ensure that the --cddl-format + -- option is accepted. This transaction body file is unused in the test. + void $ H.execCli' execConfig + [ "transaction", "build" + , "--alonzo-era" + , "--testnet-magic", show @Int testnetMagic + , "--change-address", utxoAddr + , "--tx-in", T.unpack $ renderTxIn txin + , "--tx-out", poolowneraddresswstakecred <> "+" <> show @Int 5000000 + , "--tx-out", utxoaddrwithstaking <> "+" <> show @Int 5000000 + , "--witness-override", show @Int 3 + , "--certificate-file", work "pledger.regcert2" + , "--cddl-format" -- TODO delete in the next release after 1.35.4 + , "--out-file", work "pledge-registration-cert.txbody" + ] + void $ H.execCli [ "transaction", "sign" , "--tx-body-file", work "pledge-registration-cert.txbody"