bugfix: NFC verify address wrong error message

This commit is contained in:
scgbckbone 2026-04-15 14:56:02 +02:00 committed by doc-hex
parent 883be60fc5
commit 3a1ef6fe50
3 changed files with 38 additions and 4 deletions

View File

@ -12,6 +12,7 @@ This lists the new changes that have not yet been published in a normal release.
- Bugfix: Yikes when using "Send Password" on entry with password None field
- Bugfix: Do not show "Saving..." UX after failed Notes & Passwords import
- Bugfix: Incorrect error message caused by error in Verify/Decrypt Backup
- Bugfix: NFC Verify Address raised incorrect error message
# Mk Specific Changes

View File

@ -747,10 +747,11 @@ class NFCHandler:
async def verify_address_nfc(self):
# Get an address or complete bip-21 url even and search it... slow.
_, addr, args = await self.read_address()
if addr:
from ownership import OWNERSHIP
await OWNERSHIP.search_ux(addr, args)
res = await self.read_address()
if not res: return
_, addr, args = res
from ownership import OWNERSHIP
await OWNERSHIP.search_ux(addr, args)
async def read_extended_private_key(self):
f = lambda x: x.decode().strip() if b"prv" in x else None

View File

@ -666,4 +666,36 @@ def test_nfc_share_files(fname, mode, ftype, nfc_read_json, nfc_read_text,
assert res == contents
os.remove(f'{sim_root_dir}/MicroSD/' + fname)
def test_verify_address_nfc_cancel(goto_home, pick_menu_item, press_cancel,
cap_story, enable_nfc, cap_menu, nfc_write,
nfc_write_text):
# pressing cancel during 'Verify Address' NFC prompt must not "crash".
enable_nfc()
goto_home()
pick_menu_item("Advanced/Tools")
pick_menu_item("NFC Tools")
pick_menu_item("Verify Address")
time.sleep(0.1)
press_cancel()
time.sleep(0.1)
assert "Verify Address" in cap_menu()
pick_menu_item("Verify Address")
nfc_write_text("empty")
time.sleep(0.1)
title, story = cap_story()
assert "Unable to find address from NFC data" in story
press_cancel()
time.sleep(.1)
assert "Verify Address" in cap_menu()
pick_menu_item("Verify Address")
nfc_write(b"empty")
time.sleep(0.1)
title, story = cap_story()
assert "No tag data" in story
press_cancel()
time.sleep(.1)
assert "Verify Address" in cap_menu()
# EOF