Skip to content

Commit

Permalink
Merge pull request #16 from kangtinglee/main
Browse files Browse the repository at this point in the history
Update code to cardano-cli 1.26.1
  • Loading branch information
Marcus Lee authored Apr 24, 2021
2 parents 8be7e86 + 2006ecc commit 5b7e7d0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions automint/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def get_policy_id(policy_script_path):
return proc.stdout.strip('\n')


def build_raw_transaction(working_dir, input_utxos, output_accounts, policy_id=None, minting_account=None, fee=0, metadata=None, invalid_after=None):
def build_raw_transaction(working_dir, input_utxos, output_accounts, policy_id=None, minting_account=None, fee=0, metadata=None, invalid_after=None, script_path=None):
"""Builds transactions"""

if type(input_utxos) != list:
Expand Down Expand Up @@ -135,6 +135,10 @@ def build_raw_transaction(working_dir, input_utxos, output_accounts, policy_id=N
cmd_builder.append('--invalid-hereafter')
cmd_builder.append(str(invalid_after))

if minting_account:
cmd_builder.append('--minting-script-file')
cmd_builder.append(script_path)

cmd = " ".join(cmd_builder)

logger.debug(f'Transaction build command:\n{cmd}')
Expand Down Expand Up @@ -178,7 +182,7 @@ def calculate_tx_fee(raw_matx_path, protocol_json_path, input_utxos, output_acco
return int(proc.stdout.split()[0])


def sign_tx(nft_dir, signing_wallets, raw_matx_path, script_path=None, force=False):
def sign_tx(nft_dir, signing_wallets, raw_matx_path, force=False):
"""Generate and write signed transaction file"""
if type(signing_wallets) != list:
signing_wallets = [signing_wallets]
Expand All @@ -199,10 +203,6 @@ def sign_tx(nft_dir, signing_wallets, raw_matx_path, script_path=None, force=Fal
cmd_builder.append('--signing-key-file')
cmd_builder.append(wallet.get_skey_path())

if script_path:
cmd_builder.append('--script-file')
cmd_builder.append(script_path)

cmd = ' '.join(cmd_builder)

proc = subprocess.run(cmd, capture_output=True, text=True, shell=True)
Expand Down

0 comments on commit 5b7e7d0

Please sign in to comment.