From 961499fdcf6a96582845d72317be2488f2b26d8d Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Tue, 28 May 2019 15:57:04 +0200 Subject: [PATCH] core: fix uppercase ripple address in qr code Fixes #191 --- core/src/apps/ripple/get_address.py | 2 +- core/src/apps/wallet/get_address.py | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/core/src/apps/ripple/get_address.py b/core/src/apps/ripple/get_address.py index 5ae24abd16..cad770c4ed 100644 --- a/core/src/apps/ripple/get_address.py +++ b/core/src/apps/ripple/get_address.py @@ -20,7 +20,7 @@ async def get_address(ctx, msg: RippleGetAddress, keychain): while True: if await show_address(ctx, address, desc=desc): break - if await show_qr(ctx, address.upper(), desc=desc): + if await show_qr(ctx, address, desc=desc): break return RippleAddress(address=address) diff --git a/core/src/apps/wallet/get_address.py b/core/src/apps/wallet/get_address.py index e8fedcd3bc..a35bfdee73 100644 --- a/core/src/apps/wallet/get_address.py +++ b/core/src/apps/wallet/get_address.py @@ -24,22 +24,21 @@ async def get_address(ctx, msg, keychain): node = keychain.derive(msg.address_n, coin.curve_name) address = addresses.get_address(msg.script_type, coin, node, msg.multisig) 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.multisig: desc = "Multisig %d of %d" % (msg.multisig.m, len(msg.multisig.pubkeys)) else: desc = address_n_to_str(msg.address_n) + while True: if await show_address(ctx, address_short, desc=desc): break - if await show_qr( - ctx, - address.upper() - if msg.script_type == InputScriptType.SPENDWITNESS - else address, - desc=desc, - ): + if await show_qr(ctx, address_qr, desc=desc): break return Address(address=address)