You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/src/apps/common/layout.py

24 lines
506 B

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])