mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-18 05:28:40 +00:00
src: import hexlify explicitly, fix hexlify usage
This commit is contained in:
parent
4a7592d470
commit
7d1d6ce393
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user