Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore --cddl-format #4617

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cardano-cli/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 $
Expand Down
15 changes: 15 additions & 0 deletions cardano-cli/test/Test/Golden/Shelley/TextEnvelope/Tx/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 17 additions & 0 deletions cardano-testnet/test/Spec/Cli/KesPeriodInfo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down