mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 11:28:14 +00:00
apps/management/reset_device: fix display clear, move pin request
This commit is contained in:
parent
a7f011d59e
commit
5f76dc714a
@ -37,17 +37,17 @@ async def reset_device(ctx, msg):
|
||||
FailureType.UnexpectedMessage,
|
||||
'Already initialized')
|
||||
|
||||
# generate and display internal entropy
|
||||
internal_entropy = random.bytes(32)
|
||||
if msg.display_random:
|
||||
await show_entropy(ctx, internal_entropy)
|
||||
|
||||
# request new PIN
|
||||
if msg.pin_protection:
|
||||
newpin = await request_pin_confirm(ctx)
|
||||
else:
|
||||
newpin = ''
|
||||
|
||||
# generate and display internal entropy
|
||||
internal_entropy = random.bytes(32)
|
||||
if msg.display_random:
|
||||
await show_entropy(ctx, internal_entropy)
|
||||
|
||||
# request external entropy and compute mnemonic
|
||||
ext_ack = await ctx.call(EntropyRequest(), wire_types.EntropyAck)
|
||||
mnemonic = generate_mnemonic(
|
||||
@ -160,11 +160,11 @@ async def show_mnemonic_page(page: int, page_count: int, pages: list):
|
||||
lines = ['%d. %s' % (wi + 1, word) for wi, word in pages[page]]
|
||||
content = Text('Recovery seed', ui.ICON_RESET, ui.MONO, *lines)
|
||||
content = Scrollpage(content, page, page_count)
|
||||
ui.display.clear()
|
||||
|
||||
if page + 1 == page_count:
|
||||
await HoldToConfirmDialog(content)
|
||||
else:
|
||||
ui.display.clear()
|
||||
content.render()
|
||||
await animate_swipe()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user