From cb105c015fa0e73b55aac079238989a12a1ecfd9 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Tue, 21 Aug 2018 11:16:44 +0200 Subject: [PATCH] stellar: get public key simplified --- src/apps/stellar/get_public_key.py | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/apps/stellar/get_public_key.py b/src/apps/stellar/get_public_key.py index 7e79526d64..fce9e73809 100644 --- a/src/apps/stellar/get_public_key.py +++ b/src/apps/stellar/get_public_key.py @@ -1,14 +1,8 @@ -from ubinascii import hexlify - -from trezor import ui -from trezor.messages import ButtonRequestType from trezor.messages.StellarGetPublicKey import StellarGetPublicKey from trezor.messages.StellarPublicKey import StellarPublicKey -from trezor.ui.text import Text from apps.common import seed -from apps.common.confirm import confirm -from apps.common.show import split_address +from apps.common.show import show_pubkey from apps.stellar import helpers @@ -17,18 +11,6 @@ async def get_public_key(ctx, msg: StellarGetPublicKey): pubkey = seed.remove_ed25519_prefix(node.public_key()) if msg.show_display: - while True: - if await _show(ctx, pubkey): - break + await show_pubkey(ctx, pubkey) return StellarPublicKey(public_key=pubkey) - - -async def _show(ctx, pubkey: bytes): - lines = split_address(hexlify(pubkey)) - text = Text("Export Stellar ID", ui.ICON_RECEIVE, icon_color=ui.GREEN) - text.mono(*lines) - - return await confirm( - ctx, text, code=ButtonRequestType.Address, cancel_style=ui.BTN_KEY - )