1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-17 05:03:07 +00:00
trezor-firmware/src/apps/wallet/layout_sign_message.py

21 lines
731 B
Python
Raw Normal View History

2016-06-09 15:34:43 +00:00
from trezor import wire, ui
from trezor.utils import unimport
2016-06-09 15:34:43 +00:00
from trezor.workflows.confirm import confirm
@unimport
2016-06-09 15:34:43 +00:00
def layout_sign_message(message):
ui.clear()
ui.display.text(10, 30, 'Signing message',
ui.BOLD, ui.LIGHT_GREEN, ui.BLACK)
2016-06-09 15:34:43 +00:00
ui.display.text(10, 60, message.message, ui.MONO, ui.WHITE, ui.BLACK)
2016-06-10 13:35:22 +00:00
confirmed = yield from confirm(confirm='Sign')
2016-06-09 15:34:43 +00:00
if confirmed:
from trezor.messages.Success import Success
yield from wire.write(Success(message='Signed'))
else:
from trezor.messages.Failure import Failure
from trezor.messages.FailureType import ActionCancelled
yield from wire.write(Failure(message='Cancelled', code=ActionCancelled))