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

src: import hexlify explicitly, fix hexlify usage

This commit is contained in:
Pavol Rusnak 2018-01-04 13:24:39 +01:00
parent 4a7592d470
commit 7d1d6ce393
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 5 additions and 5 deletions

View File

@ -401,7 +401,7 @@ class ConfirmContent(ui.Widget):
self.boot()
def boot(self) -> None:
import ubinascii
from ubinascii import hexlify
from trezor import res
from . import knownapps
@ -418,7 +418,7 @@ class ConfirmContent(ui.Widget):
except FileNotFoundError:
icon = res.load('apps/fido_u2f/res/u2f_generic.toif')
else:
name = '%s...%s' % (ubinascii.hexlify(app_id[:4]), ubinascii.hexlify(app_id[-4:]))
name = '%s...%s' % (hexlify(app_id[:4]).decode(), hexlify(app_id[-4:]).decode())
icon = res.load('apps/fido_u2f/res/u2f_generic.toif')
self.app_name = name
self.app_icon = icon

View File

@ -2,7 +2,7 @@ from micropython import const
from trezor import wire, ui
from trezor.ui.container import Container
from trezor.utils import unimport, chunks
import ubinascii
from ubinascii import hexlify
if __debug__:
internal_entropy = None
@ -37,8 +37,8 @@ async def layout_reset_device(ctx, msg):
internal_entropy = random.bytes(32)
if msg.display_random:
entropy_lines = chunks(ubinascii.hexlify(internal_entropy), 16)
entropy_content = Text('Internal entropy', ui.ICON_RESET, *entropy_lines)
entropy_lines = chunks(hexlify(internal_entropy).decode(), 16)
entropy_content = Text('Internal entropy', ui.ICON_RESET, ui.MONO, *entropy_lines)
await require_confirm(ctx, entropy_content, ButtonRequestType.ResetDevice)
if msg.pin_protection: