From 119e9ef0fa4852899520dec537dd7d94e218aa38 Mon Sep 17 00:00:00 2001 From: scgbckbone Date: Wed, 11 Mar 2026 15:10:29 +0100 Subject: [PATCH] bugfix: do not offer to show QR code of TXID if txn is not finalized --- shared/auth.py | 4 +++- testing/test_sign.py | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/shared/auth.py b/shared/auth.py index cd8ba457..13a624ec 100644 --- a/shared/auth.py +++ b/shared/auth.py @@ -874,9 +874,11 @@ async def done_signing(psbt, tx_req, input_method=None, filename=None, if not ch: # show all possible export options (based on hardware enabled, features) intro = [] + key6 = None if msg: intro.append(msg) if txid: + key6 = "for QR Code of TXID" intro.append('TXID:\n' + txid) # "force_prompt" is needed after first iteration as we can be Mk4, with NFC,Vdisk off, @@ -884,7 +886,7 @@ async def done_signing(psbt, tx_req, input_method=None, filename=None, # In that case this would just return dict and keep producing signed # files on SD infinitely (would never actually prompt). ch = await import_export_prompt(noun, intro="\n\n".join(intro), offer_kt=offer_kt, - key6="for QR Code of TXID", title=title, + key6=key6, title=title, force_prompt=not first_time, no_qr=not version.has_qwerty or not allow_qr) if ch == KEY_CANCEL: diff --git a/testing/test_sign.py b/testing/test_sign.py index 8547db0e..f34ae30c 100644 --- a/testing/test_sign.py +++ b/testing/test_sign.py @@ -3983,4 +3983,21 @@ def test_duplicate_inputs(addr_fmt, num_ins, fake_txn, start_sign, end_sign, cap else: assert title == "OK TO SEND?" + +def test_txid_qr(fake_txn, start_sign, cap_story, press_cancel, press_select): + psbt = fake_txn(1, 2) + start_sign(psbt, finalize=False) + press_select() # confirm signing + time.sleep(.1) + title, story = cap_story() + assert "(6) for QR Code of TXID" not in story + press_cancel() # refuse + time.sleep(.1) + start_sign(psbt, finalize=True) + press_select() # confirm signing + time.sleep(.1) + title, story = cap_story() + assert "(6) for QR Code of TXID" in story + press_cancel() + # EOF \ No newline at end of file