diff --git a/staking_deposit/cli/exit_transaction_keystore.py b/staking_deposit/cli/exit_transaction_keystore.py index 029ac2f2..1216f94d 100644 --- a/staking_deposit/cli/exit_transaction_keystore.py +++ b/staking_deposit/cli/exit_transaction_keystore.py @@ -114,6 +114,8 @@ def exit_transaction_keystore( ) folder = os.path.join(output_folder, DEFAULT_EXIT_TRANSACTION_FOLDER_NAME) + if not os.path.exists(folder): + os.mkdir(folder) click.echo(load_text(['msg_exit_transaction_creation'])) saved_folder = export_exit_transaction_json(folder=folder, signed_exit=signed_exit) diff --git a/staking_deposit/cli/exit_transaction_mnemonic.py b/staking_deposit/cli/exit_transaction_mnemonic.py index 3fb36c6f..56a081f8 100644 --- a/staking_deposit/cli/exit_transaction_mnemonic.py +++ b/staking_deposit/cli/exit_transaction_mnemonic.py @@ -129,6 +129,9 @@ def exit_transaction_mnemonic( credentials.append(credential) bar.update(1) + if not os.path.exists(folder): + os.mkdir(folder) + transaction_filefolders = [] with click.progressbar(length=num_keys, label=load_text(['msg_exit_transaction_creation']), show_percent=False, show_pos=True) as bar: diff --git a/staking_deposit/exit_transaction.py b/staking_deposit/exit_transaction.py index c73376fd..608409a3 100644 --- a/staking_deposit/exit_transaction.py +++ b/staking_deposit/exit_transaction.py @@ -48,9 +48,6 @@ def export_exit_transaction_json(folder: str, signed_exit: SignedVoluntaryExit) signed_exit_json.update({'message': message}) signed_exit_json.update({'signature': '0x' + signed_exit.signature.hex()}) # type: ignore[attr-defined] - if not os.path.exists(folder): - os.mkdir(folder) - filefolder = os.path.join( folder, 'signed_exit_transaction-%s-%i.json' % (