Skip to content

Commit

Permalink
Add support for --cddl-format option
Browse files Browse the repository at this point in the history
The cli currently has an intermediate TxBody type that is serialised in an intermediate format which does not follow cardano-ledger's CDDL spec.
A flag was added to the cli allowing the CDDL serialisation of any relevant outputs. Eventually the cli's intermediate format will be deprecated.

See IntersectMBO/cardano-node#3544
  • Loading branch information
mkoura committed Jan 28, 2022
1 parent 412bbe0 commit d445475
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cardano_clusterlib/clusterlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ def __init__(
self.tx_era = tx_era
self.tx_era_arg = [f"--{self.tx_era.lower()}-era"] if self.tx_era else []

# TODO: add temporary switch for CDDL format, until it is made default
self.use_cddl = False

self.protocol = protocol
self._check_protocol()

Expand Down Expand Up @@ -2185,6 +2188,8 @@ def build_raw_tx_bare( # noqa: C901
]
)

format_args = ["--cddl-format"] if self.use_cddl else []

self.cli(
[
"transaction",
Expand All @@ -2207,6 +2212,7 @@ def build_raw_tx_bare( # noqa: C901
*bound_args,
*mint_args,
*script_args,
*format_args,
*self.tx_era_arg,
]
)
Expand Down Expand Up @@ -2677,6 +2683,8 @@ def build_tx( # noqa: C901
if witness_override is not None:
witness_override_args = ["--witness-override", str(witness_override)]

format_args = ["--cddl-format"] if self.use_cddl else []

stdout = self.cli(
[
"transaction",
Expand All @@ -2697,6 +2705,7 @@ def build_tx( # noqa: C901
*mint_args,
*script_args,
*witness_override_args,
*format_args,
*self.tx_era_arg,
*self.magic_args,
"--out-file",
Expand Down

0 comments on commit d445475

Please sign in to comment.