1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-15 11:08:08 +00:00
trezor-firmware/core/src/apps/binance/get_public_key.py
matejcik 4ca8f7b0d6 style(core): use relative imports everywhere
except Monero, which has a rather complex structure and I don't want to
search&replace mess with it in case some of the things break memory
layout
2020-11-05 14:30:11 +01:00

22 lines
715 B
Python

from trezor.messages.BinanceGetPublicKey import BinanceGetPublicKey
from trezor.messages.BinancePublicKey import BinancePublicKey
from apps.common import layout, paths
from apps.common.keychain import Keychain, with_slip44_keychain
from . import CURVE, SLIP44_ID, helpers
@with_slip44_keychain(SLIP44_ID, CURVE, allow_testnet=True)
async def get_public_key(ctx, msg: BinanceGetPublicKey, keychain: Keychain):
await paths.validate_path(
ctx, helpers.validate_full_path, keychain, msg.address_n, CURVE
)
node = keychain.derive(msg.address_n)
pubkey = node.public_key()
if msg.show_display:
await layout.show_pubkey(ctx, pubkey)
return BinancePublicKey(public_key=pubkey)