parent
875cc0cb1a
commit
574dcbc8a3
@ -1,17 +0,0 @@
|
||||
from micropython import const
|
||||
|
||||
from trezor import workflow
|
||||
from trezor.enums import ButtonRequestType
|
||||
from trezor.messages import ButtonAck, ButtonRequest
|
||||
|
||||
if False:
|
||||
from trezor import wire
|
||||
|
||||
HARDENED = const(0x8000_0000)
|
||||
|
||||
|
||||
async def button_request(
|
||||
ctx: wire.GenericContext, code: ButtonRequestType = ButtonRequestType.Other
|
||||
) -> None:
|
||||
workflow.close_others()
|
||||
await ctx.call(ButtonRequest(code=code), ButtonAck)
|
@ -1,23 +0,0 @@
|
||||
from trezor.utils import chunks
|
||||
|
||||
from apps.common import HARDENED
|
||||
|
||||
if False:
|
||||
from typing import Iterable, Iterator
|
||||
|
||||
|
||||
def split_address(address: str) -> Iterator[str]:
|
||||
return chunks(address, 17)
|
||||
|
||||
|
||||
def address_n_to_str(address_n: Iterable[int]) -> str:
|
||||
def path_item(i: int) -> str:
|
||||
if i & HARDENED:
|
||||
return str(i ^ HARDENED) + "'"
|
||||
else:
|
||||
return str(i)
|
||||
|
||||
if not address_n:
|
||||
return "m"
|
||||
|
||||
return "m/" + "/".join([path_item(i) for i in address_n])
|
Loading…
Reference in new issue