1
0

qt wizard: fix restoring from 2fa seed

follow-up 7df057aaf9
This commit is contained in:
SomberNight
2024-01-05 12:51:54 +00:00
parent 3b630c7a5b
commit 201c0ab71b
2 changed files with 4 additions and 2 deletions

View File

@@ -617,12 +617,13 @@ class WCHaveSeed(WizardComponent, Logger):
self.layout().addStretch(1) self.layout().addStretch(1)
def is_seed(self, x): def is_seed(self, x):
t = mnemonic.seed_type(x)
if self.wizard_data['wallet_type'] == 'standard': if self.wizard_data['wallet_type'] == 'standard':
return mnemonic.is_seed(x) return mnemonic.is_seed(x)
elif self.wizard_data['wallet_type'] == '2fa': elif self.wizard_data['wallet_type'] == '2fa':
return mnemonic.is_any_2fa_seed_type(x) return mnemonic.is_any_2fa_seed_type(t)
else: else:
return mnemonic.seed_type(x) in ['standard', 'segwit'] return t in ['standard', 'segwit']
def validate(self): def validate(self):
# precond: only call when SeedLayout deems seed a valid seed # precond: only call when SeedLayout deems seed a valid seed

View File

@@ -189,6 +189,7 @@ class Test_seeds(ElectrumTestCase):
('9dk', 'segwit'), ('9dk', 'segwit'),
('abandon bike', 'segwit'), # <- has valid English words ('abandon bike', 'segwit'), # <- has valid English words
('6vs', '2fa_segwit'), ('6vs', '2fa_segwit'),
('agree install', '2fa_segwit'), # <- has valid English words
} }
def test_new_seed(self): def test_new_seed(self):