1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00

core: fix uppercase ripple address in qr code

Fixes #191
This commit is contained in:
Jan Pochyla 2019-05-28 15:57:04 +02:00 committed by Tomas Susanka
parent fc41a7a232
commit 50cb440d9a
2 changed files with 7 additions and 8 deletions

View File

@ -20,7 +20,7 @@ async def get_address(ctx, msg: RippleGetAddress, keychain):
while True: while True:
if await show_address(ctx, address, desc=desc): if await show_address(ctx, address, desc=desc):
break break
if await show_qr(ctx, address.upper(), desc=desc): if await show_qr(ctx, address, desc=desc):
break break
return RippleAddress(address=address) return RippleAddress(address=address)

View File

@ -24,22 +24,21 @@ async def get_address(ctx, msg, keychain):
node = keychain.derive(msg.address_n, coin.curve_name) node = keychain.derive(msg.address_n, coin.curve_name)
address = addresses.get_address(msg.script_type, coin, node, msg.multisig) address = addresses.get_address(msg.script_type, coin, node, msg.multisig)
address_short = addresses.address_short(coin, address) address_short = addresses.address_short(coin, address)
if msg.script_type == InputScriptType.SPENDWITNESS:
address_qr = address.upper() # bech32 address
else:
address_qr = address # base58 address
if msg.show_display: if msg.show_display:
if msg.multisig: if msg.multisig:
desc = "Multisig %d of %d" % (msg.multisig.m, len(msg.multisig.pubkeys)) desc = "Multisig %d of %d" % (msg.multisig.m, len(msg.multisig.pubkeys))
else: else:
desc = address_n_to_str(msg.address_n) desc = address_n_to_str(msg.address_n)
while True: while True:
if await show_address(ctx, address_short, desc=desc): if await show_address(ctx, address_short, desc=desc):
break break
if await show_qr( if await show_qr(ctx, address_qr, desc=desc):
ctx,
address.upper()
if msg.script_type == InputScriptType.SPENDWITNESS
else address,
desc=desc,
):
break break
return Address(address=address) return Address(address=address)