Skip to content

Commit

Permalink
SFT-2235: added error handling to showing the signed QR
Browse files Browse the repository at this point in the history
  • Loading branch information
mjg-foundation committed Jul 20, 2023
1 parent 5c3d576 commit 7ddc843
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions ports/stm32/boards/Passport/modules/flows/sign_psbt_qr_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ async def get_signed_bytes(self):
self.goto(self.show_signed_transaction)

async def show_signed_transaction(self):
from pages import ShowQRPage
from pages import ShowQRPage, ErrorPage
from data_codecs.qr_type import QRType
from ubinascii import hexlify as b2a_hex
import microns
Expand All @@ -155,10 +155,16 @@ async def show_signed_transaction(self):
else:
raise RuntimeError('Unknown UR type: {}'.format(self.ur_type))

result = await ShowQRPage(qr_type=qr_type,
qr_data=qr_data,
left_micron=microns.MicroSD,
right_micron=microns.Checkmark).show()
result = False
try:
result = await ShowQRPage(qr_type=qr_type,
qr_data=qr_data,
left_micron=microns.MicroSD,
right_micron=microns.Checkmark).show()
except MemoryError as e:
await ErrorPage(text='Transaction is too complex: {}'.format(e)).show()
self.set_result(False)
return

if not result:
self.goto(self.save_to_microsd)
Expand Down

0 comments on commit 7ddc843

Please sign in to comment.