mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 22:38:08 +00:00
move sub-workflows do apps/common
This commit is contained in:
parent
c93133026e
commit
0e799d62af
@ -16,7 +16,7 @@ async def request_pin(session_id, *args, **kwargs):
|
||||
ButtonRequest(code=ProtectCall),
|
||||
ButtonAck)
|
||||
|
||||
ui.display.clear()
|
||||
ui.clear()
|
||||
matrix = PinMatrix(*args, **kwargs)
|
||||
dialog = ConfirmDialog(matrix)
|
||||
if await dialog != CONFIRMED:
|
@ -7,8 +7,8 @@ async def layout_reset_device(message, session_id):
|
||||
from trezor.messages.Success import Success
|
||||
from trezor.messages.Storage import Storage
|
||||
from trezor.messages.FailureType import UnexpectedMessage
|
||||
from .storage import get_storage, set_storage
|
||||
from .request_pin import request_pin_twice
|
||||
from ..common.storage import get_storage, set_storage
|
||||
from ..common.request_pin import request_pin_twice
|
||||
|
||||
if get_storage(session_id):
|
||||
raise wire.FailureError(UnexpectedMessage, 'Already initialized')
|
||||
|
@ -6,16 +6,17 @@ from trezor.utils import unimport
|
||||
async def layout_wipe_device(message, session_id):
|
||||
from trezor.messages.Success import Success
|
||||
from trezor.ui.text import Text
|
||||
from .confirm import hold_to_confirm
|
||||
from .storage import clear_storage
|
||||
from ..common.confirm import hold_to_confirm
|
||||
from ..common.storage import clear_storage
|
||||
|
||||
ui.display.clear()
|
||||
|
||||
content = Text('Wiping device',
|
||||
ui.BOLD, 'Do you really want to', 'wipe the device?',
|
||||
ui.NORMAL, '', 'All data will be lost.')
|
||||
content = Text(
|
||||
'Wiping device',
|
||||
ui.BOLD, 'Do you really want to', 'wipe the device?',
|
||||
ui.NORMAL, '', 'All data will be lost.')
|
||||
await hold_to_confirm(session_id, content)
|
||||
|
||||
clear_storage(session_id)
|
||||
|
||||
return Success(message='Wiped')
|
||||
return Success(message='Device wiped')
|
||||
|
Loading…
Reference in New Issue
Block a user