1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 14:58:09 +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), ButtonRequest(code=ProtectCall),
ButtonAck) ButtonAck)
ui.display.clear() ui.clear()
matrix = PinMatrix(*args, **kwargs) matrix = PinMatrix(*args, **kwargs)
dialog = ConfirmDialog(matrix) dialog = ConfirmDialog(matrix)
if await dialog != CONFIRMED: 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.Success import Success
from trezor.messages.Storage import Storage from trezor.messages.Storage import Storage
from trezor.messages.FailureType import UnexpectedMessage from trezor.messages.FailureType import UnexpectedMessage
from .storage import get_storage, set_storage from ..common.storage import get_storage, set_storage
from .request_pin import request_pin_twice from ..common.request_pin import request_pin_twice
if get_storage(session_id): if get_storage(session_id):
raise wire.FailureError(UnexpectedMessage, 'Already initialized') 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): async def layout_wipe_device(message, session_id):
from trezor.messages.Success import Success from trezor.messages.Success import Success
from trezor.ui.text import Text from trezor.ui.text import Text
from .confirm import hold_to_confirm from ..common.confirm import hold_to_confirm
from .storage import clear_storage from ..common.storage import clear_storage
ui.display.clear() ui.display.clear()
content = Text('Wiping device', content = Text(
'Wiping device',
ui.BOLD, 'Do you really want to', 'wipe the device?', ui.BOLD, 'Do you really want to', 'wipe the device?',
ui.NORMAL, '', 'All data will be lost.') ui.NORMAL, '', 'All data will be lost.')
await hold_to_confirm(session_id, content) await hold_to_confirm(session_id, content)
clear_storage(session_id) clear_storage(session_id)
return Success(message='Wiped') return Success(message='Device wiped')