bugfix: do not offer to show QR code of TXID if txn is not finalized
This commit is contained in:
parent
ce79507a9a
commit
119e9ef0fa
@ -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:
|
||||
|
||||
@ -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
|
||||
Loading…
Reference in New Issue
Block a user