diff --git a/mmgen/autosign.py b/mmgen/autosign.py index 92c93bcc..c2928a1a 100755 --- a/mmgen/autosign.py +++ b/mmgen/autosign.py @@ -817,14 +817,19 @@ class Autosign: remove_wallet_dir() create_wallet_dir() - wf = find_file_in_dir(get_wallet_cls('mmgen'), self.cfg.data_dir) - if wf and keypress_confirm( + def get_mn_wallet(): + return Wallet(self.cfg, in_fmt=self.mn_fmts[self.cfg.mnemonic_fmt or self.dfl_mn_fmt]) + + if self.cfg.mnemonic_fmt or self.cfg.seed_len: + ss_in = get_mn_wallet() + elif (wf := find_file_in_dir(get_wallet_cls('mmgen'), self.cfg.data_dir)) and keypress_confirm( cfg = self.cfg, prompt = f'Default wallet ‘{wf}’ found.\nUse default wallet for autosigning?', default_yes = True): ss_in = Wallet(Config(), fn=wf) else: - ss_in = Wallet(self.cfg, in_fmt=self.mn_fmts[self.cfg.mnemonic_fmt or self.dfl_mn_fmt]) + ss_in = get_mn_wallet() + ss_out = Wallet(self.cfg, ss=ss_in, passwd_file=str(self.keyfile)) ss_out.write_to_file(desc='autosign wallet', outdir=self.wallet_dir) diff --git a/mmgen/main_autosign.py b/mmgen/main_autosign.py index 0af456c2..179eaef6 100755 --- a/mmgen/main_autosign.py +++ b/mmgen/main_autosign.py @@ -42,7 +42,8 @@ opts_data = { the file in volatile memory for use during the signing session, thus permitting the deletion of the original file for increased security. --l, --seed-len=N Specify wallet seed length of ‘N’ bits (for setup only) +-l, --seed-len=N Specify wallet seed length of ‘N’ bits (for setup with + mnemonic seed phrase only) -L, --led Use status LED to signal standby, busy and error -m, --mountpoint=M Specify an alternate mountpoint 'M' (default: {asi.dfl_mountpoint!r}) diff --git a/test/cmdtest_d/autosign.py b/test/cmdtest_d/autosign.py index 312f2515..14e390b5 100755 --- a/test/cmdtest_d/autosign.py +++ b/test/cmdtest_d/autosign.py @@ -227,8 +227,6 @@ class CmdTestAutosignBase(CmdTestBase): t.expect('Use default wallet for autosigning? (Y/n): ', 'y') t.passphrase('MMGen wallet', wallet_passwd) else: - if use_dfl_wallet is not None: # None => no dfl wallet present - t.expect('Use default wallet for autosigning? (Y/n): ', 'n') mn_file = mn_file or {'mmgen': dfl_words_file, 'bip39': dfl_bip39_file}[mn_type] mn = read_from_file(mn_file).strip().split() if not seed_len: