1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-05-25 10:18:45 +00:00

src.apps.wallet: optimize QR code for segwit address

as they are case-insensitive and QR code has special mode
for uppercase letters
This commit is contained in:
Pavol Rusnak 2018-02-22 17:04:20 +01:00
parent d9324f3e57
commit d8ac07e455
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -4,6 +4,7 @@ from trezor import wire, ui
async def layout_get_address(ctx, msg): async def layout_get_address(ctx, msg):
from trezor.messages.Address import Address from trezor.messages.Address import Address
from trezor.messages.InputScriptType import SPENDWITNESS
from trezor.messages.FailureType import ProcessError from trezor.messages.FailureType import ProcessError
from ..common import coins from ..common import coins
from ..common import seed from ..common import seed
@ -23,7 +24,7 @@ async def layout_get_address(ctx, msg):
while True: while True:
if await _show_address(ctx, address): if await _show_address(ctx, address):
break break
if await _show_qr(ctx, address): if await _show_qr(ctx, address if msg.script_type != SPENDWITNESS else address.upper()):
break break
return Address(address=address) return Address(address=address)