Skip to content

Commit 987b814

Browse files
authored
Merge pull request #262 from input-output-hk/match_new_fee_out
fix(transaction): handle fee parsing for newer CLI output
2 parents daa731f + fb9e798 commit 987b814

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cardano_clusterlib/transaction_group.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,13 +1013,15 @@ def build_tx( # noqa: C901
10131013
*self._clusterlib_obj.magic_args,
10141014
*self._clusterlib_obj.socket_args,
10151015
]
1016-
stdout = self._clusterlib_obj.cli(cli_args).stdout
1016+
stdout = self._clusterlib_obj.cli(cli_args).stdout.strip()
10171017
stdout_dec = stdout.decode("utf-8") if stdout else ""
10181018

1019-
# check for the presence of fee information so compatibility with older versions
1020-
# of the `build` command is preserved
1019+
# Check for the presence of fee information. No fee information was provided in older
1020+
# versions of the `build` command.
10211021
estimated_fee = -1
1022-
if "transaction fee" in stdout_dec:
1022+
if stdout_dec.endswith("Lovelace"):
1023+
estimated_fee = int(stdout_dec.split()[-2])
1024+
elif "transaction fee" in stdout_dec:
10231025
estimated_fee = int(stdout_dec.split()[-1])
10241026

10251027
return structs.TxRawOutput(

0 commit comments

Comments
 (0)