diff --git a/shared/auth.py b/shared/auth.py index cd267dc4..76900b3d 100644 --- a/shared/auth.py +++ b/shared/auth.py @@ -861,9 +861,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, @@ -871,8 +873,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, - force_prompt=not first_time, + key6=key6, title=title, force_prompt=not first_time, no_qr=not version.has_qwerty) if ch == KEY_CANCEL: UserAuthorizedAction.cleanup() diff --git a/testing/test_sign.py b/testing/test_sign.py index b0317619..f97a2709 100644 --- a/testing/test_sign.py +++ b/testing/test_sign.py @@ -3657,4 +3657,21 @@ def test_duplicate_inputs(segwit_in, num_ins, fake_txn, start_sign, end_sign, ca 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, change_outputs=[0]) + 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