bugfix: empty b39 pwd number selection causes type error
(cherry picked from commit 0fa8c8b0d2)
This commit is contained in:
parent
15005d307e
commit
3cd47cdc5c
@ -821,12 +821,15 @@ class PassphraseMenu(MenuSystem):
|
||||
|
||||
async def add_numbers(self, *a):
|
||||
global pp_sofar
|
||||
pp_sofar = await ux_input_numbers(pp_sofar, self.check_length)
|
||||
pw = await ux_input_numbers(pp_sofar, self.check_length)
|
||||
if pw is not None:
|
||||
pp_sofar = pw
|
||||
self.check_length()
|
||||
|
||||
async def empty_phrase(self, *a):
|
||||
global pp_sofar
|
||||
|
||||
if pp_sofar and len(pp_sofar) >= 3:
|
||||
if len(pp_sofar) >= 3:
|
||||
if not await ux_confirm("Press OK to clear passphrase. X to cancel."):
|
||||
return
|
||||
|
||||
|
||||
@ -127,6 +127,18 @@ def test_b39p_refused(dev, need_keypress, pw='testing 123'):
|
||||
done = dev.send_recv(CCProtocolPacker.get_passphrase_done(), timeout=None)
|
||||
|
||||
|
||||
def test_cancel_on_empty_added_numbers(pick_menu_item, goto_home, need_keypress, cap_menu):
|
||||
goto_home()
|
||||
pick_menu_item('Passphrase')
|
||||
need_keypress("y") # intro story
|
||||
pick_menu_item('Add Numbers')
|
||||
need_keypress("x") # do not add any numbers and cancel with x
|
||||
pick_menu_item('CANCEL')
|
||||
time.sleep(0.1)
|
||||
m = cap_menu()
|
||||
assert m[0] == "Ready To Sign"
|
||||
|
||||
|
||||
@pytest.mark.parametrize('haz', [ False, True ])
|
||||
def test_lockdown(dev, haz, cap_menu, pick_menu_item, set_bip39_pw, goto_home, cap_story, need_keypress, sim_exec, sim_eval, get_settings, reset_seed_words, get_setting):
|
||||
# test UX and operation of the 'seed lockdown' option
|
||||
|
||||
Loading…
Reference in New Issue
Block a user