Skip to content

Commit deddda7

Browse files
committed
Review changes
1 parent eddd442 commit deddda7

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

cardano_clusterlib/query_group.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -758,23 +758,18 @@ def get_ref_script_size(
758758
759759
Returns:
760760
dict[str, Any]: JSON output from the CLI, typically containing
761-
keys like 'refScriptSize' or 'refInputScriptSize'.
761+
keys like 'refScriptSize' or 'refInputScriptSize'.
762762
"""
763-
cli_args = ["ref-script-size", "--output-json"]
764-
765763
if txin:
766-
if isinstance(txin, str):
767-
txin = [txin]
768-
cli_args += [*helpers._prepend_flag("--tx-in", txin)]
764+
txins = [txin] if isinstance(txin, str) else txin
769765
elif utxo:
770-
if isinstance(utxo, structs.UTXOData):
771-
utxo = [utxo]
772-
utxo_formatted = [f"{u.utxo_hash}#{u.utxo_ix}" for u in utxo]
773-
cli_args += [*helpers._prepend_flag("--tx-in", utxo_formatted)]
766+
utxos = [utxo] if isinstance(utxo, structs.UTXOData) else utxo
767+
txins = [f"{u.utxo_hash}#{u.utxo_ix}" for u in utxos]
774768
else:
775769
msg = "Either `txin` or `utxo` must be specified."
776770
raise ValueError(msg)
777771

772+
cli_args = ["ref-script-size", "--output-json", *helpers._prepend_flag("--tx-in", txins)]
778773
out: dict[str, tp.Any] = json.loads(self.query_cli(cli_args))
779774
return out
780775

0 commit comments

Comments
 (0)