fix: correct container type for settings.wifs; proper button text UX with parentheses

This commit is contained in:
scgbckbone 2026-04-16 15:22:46 +02:00 committed by doc-hex
parent 300323f18d
commit 44e7be3681
3 changed files with 8 additions and 7 deletions

View File

@ -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)

View File

@ -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()

View File

@ -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)