2016-06-09 15:34:43 +00:00
|
|
|
from trezor import wire, ui
|
2016-09-21 12:24:12 +00:00
|
|
|
from trezor.utils import unimport
|
2016-06-09 15:34:43 +00:00
|
|
|
from trezor.workflows.confirm import confirm
|
|
|
|
|
2016-09-21 12:24:12 +00:00
|
|
|
|
|
|
|
@unimport
|
2016-06-09 15:34:43 +00:00
|
|
|
def layout_sign_message(message):
|
|
|
|
ui.clear()
|
2016-09-21 12:24:12 +00:00
|
|
|
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-09-21 12:24:12 +00:00
|
|
|
|
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))
|