From 0ba4153fe782cffcb0f9dcb657e5c1426475b0ae Mon Sep 17 00:00:00 2001 From: kangtinglee Date: Sat, 24 Apr 2021 13:59:57 +0800 Subject: [PATCH] Update for 1.26.1 `build-raw` now requires minting script `sign` no longer requires minting script --- automint/utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/automint/utils.py b/automint/utils.py index 9ab66bc..870ed87 100644 --- a/automint/utils.py +++ b/automint/utils.py @@ -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: @@ -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}') @@ -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] @@ -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)