1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 11:28:14 +00:00

src/apps/wallet: drop cashaddr prefix from the ui

This commit is contained in:
Pavol Rusnak 2018-06-11 13:46:26 +02:00
parent 1a0233af9d
commit 6c2c99688b
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 7 additions and 3 deletions

View File

@ -17,10 +17,11 @@ async def get_address(ctx, msg):
node = await seed.derive_node(ctx, msg.address_n)
address = addresses.get_address(msg.script_type, coin, node, msg.multisig)
address_short = address[len(coin.cashaddr_prefix) + 1:] if coin.cashaddr_prefix is not None else address
if msg.show_display:
while True:
if await _show_address(ctx, address):
if await _show_address(ctx, address_short):
break
if await _show_qr(ctx, address.upper() if msg.script_type == InputScriptType.SPENDWITNESS else address):
break

View File

@ -29,9 +29,10 @@ async def confirm_output(ctx, output, coin):
ui.MONO, *split_op_return(data), icon_color=ui.GREEN)
else:
address = output.address
address_short = address[len(coin.cashaddr_prefix) + 1:] if coin.cashaddr_prefix is not None else address
content = Text('Confirm sending', ui.ICON_SEND,
ui.NORMAL, format_coin_amount(output.amount, coin) + ' to',
ui.MONO, *split_address(address), icon_color=ui.GREEN)
ui.MONO, *split_address(address_short), icon_color=ui.GREEN)
return await confirm(ctx, content, ButtonRequestType.ConfirmOutput)

View File

@ -51,7 +51,9 @@ async def verify_message(ctx, msg):
if addr != address:
raise wire.ProcessError('Invalid signature')
await require_confirm_verify_message(ctx, address, message)
address_short = address[len(coin.cashaddr_prefix) + 1:] if coin.cashaddr_prefix is not None else address
await require_confirm_verify_message(ctx, address_short, message)
return Success(message='Message verified')