diff --git a/shared/hsm_ux.py b/shared/hsm_ux.py index 2a8b4a4f..35e113c2 100644 --- a/shared/hsm_ux.py +++ b/shared/hsm_ux.py @@ -59,7 +59,7 @@ class ApproveHSMPolicy(UserAuthorizedAction): msg = '''Last chance. You are defining a new policy which \ allows the Coldcard to sign specific transactions without any further user approval.\n\n\ Policy hash:\n%s\n\n -Press %s to save policy and enable HSM mode.''' % (self.policy.hash(), confirm_char) +Press (%s) to save policy and enable HSM mode.''' % (self.policy.hash(), confirm_char) ch = await ux_show_story(msg, title=self.title, escape='x'+confirm_char, strict_escape=True) diff --git a/shared/wif.py b/shared/wif.py index 4e91bb56..cc1d2bb0 100644 --- a/shared/wif.py +++ b/shared/wif.py @@ -224,16 +224,17 @@ class WIFStore(MenuSystem): return idx, pubkey = item.arg - wifs = settings.get('wifs', {}) + wifs = settings.get('wifs', []) if not wifs: return try: - item = wifs[idx] - assert item[0] == pubkey + entry = wifs[idx] + assert entry[0] == pubkey del wifs[idx] settings.set('wifs', wifs) settings.save() - except IndexError: pass + except IndexError: + return the_ux.pop() # pop submenu self.update_contents() diff --git a/testing/test_hsm.py b/testing/test_hsm.py index f5e99cae..0a4158c3 100644 --- a/testing/test_hsm.py +++ b/testing/test_hsm.py @@ -425,8 +425,8 @@ def start_hsm(request, dev, hsm_reset, hsm_status, need_keypress, press_select): assert 'Last chance' in body2 assert 'Policy hash:' in body2 ll = body2.split('\n')[-1] - assert ll.startswith("Press ") - ch = ll[6] + assert ll.startswith("Press (") + ch = ll[7] need_keypress(ch) time.sleep(.100)