mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-26 01:18:28 +00:00
get rid of layout stubs
This commit is contained in:
parent
01ac17440d
commit
07dd27c567
@ -1,7 +1,7 @@
|
||||
from trezor.wire import register_type, protobuf_handler
|
||||
from trezor.utils import unimport
|
||||
from trezor.messages.wire_types import \
|
||||
GetPublicKey, SignTx, SignMessage
|
||||
GetPublicKey, SignMessage
|
||||
|
||||
|
||||
@unimport
|
||||
@ -10,12 +10,6 @@ def dispatch_GetPublicKey(*args, **kwargs):
|
||||
return layout_get_public_key(*args, **kwargs)
|
||||
|
||||
|
||||
@unimport
|
||||
def dispatch_SignTx(*args, **kwargs):
|
||||
from .layout_sign_tx import layout_sign_tx
|
||||
return layout_sign_tx(*args, **kwargs)
|
||||
|
||||
|
||||
@unimport
|
||||
def dispatch_SignMessage(*args, **kwargs):
|
||||
from .layout_sign_message import layout_sign_message
|
||||
@ -24,5 +18,4 @@ def dispatch_SignMessage(*args, **kwargs):
|
||||
|
||||
def boot():
|
||||
register_type(GetPublicKey, protobuf_handler, dispatch_GetPublicKey)
|
||||
register_type(SignTx, protobuf_handler, dispatch_SignTx)
|
||||
register_type(SignMessage, protobuf_handler, dispatch_SignMessage)
|
||||
|
@ -1,20 +1,19 @@
|
||||
from trezor import wire, ui
|
||||
from trezor.utils import unimport
|
||||
from trezor.workflows.confirm import confirm
|
||||
|
||||
|
||||
@unimport
|
||||
def layout_sign_message(message):
|
||||
async def layout_sign_message(message):
|
||||
from trezor.workflows.confirm import protect_with_confirm
|
||||
from trezor.messages.Success import Success
|
||||
|
||||
ui.clear()
|
||||
ui.display.text(10, 30, 'Signing message',
|
||||
ui.BOLD, ui.LIGHT_GREEN, ui.BLACK)
|
||||
ui.display.text(10, 60, message.message, ui.MONO, ui.WHITE, ui.BLACK)
|
||||
confirmed = yield from confirm(confirm='Sign')
|
||||
|
||||
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))
|
||||
await protect_with_confirm(confirm='Sign')
|
||||
|
||||
# TODO
|
||||
|
||||
return Success(message='Signed')
|
||||
|
@ -1,8 +0,0 @@
|
||||
from trezor import wire, ui
|
||||
from trezor.utils import unimport
|
||||
|
||||
|
||||
@unimport
|
||||
def layout_sign_tx(message):
|
||||
ui.clear()
|
||||
print('sending')
|
Loading…
Reference in New Issue
Block a user