1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

move sub-workflows do apps/common

This commit is contained in:
Jan Pochyla 2016-09-28 23:30:10 +02:00
parent c93133026e
commit 0e799d62af
6 changed files with 10 additions and 9 deletions

View File

@ -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:

View File

@ -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')

View File

@ -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')