1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 03:18:09 +00:00

src/apps/homescreen: handle Cancel

This commit is contained in:
Jan Pochyla 2018-06-06 17:23:27 +02:00
parent a5952d16db
commit faccce5bd1

View File

@ -1,4 +1,4 @@
from trezor import config, utils
from trezor import config, utils, wire
from trezor.wire import register, protobuf_workflow
from trezor.messages import wire_types
from trezor.messages.Features import Features
@ -41,6 +41,10 @@ async def handle_GetFeatures(ctx, msg):
return get_features()
async def handle_Cancel(ctx, msg):
raise wire.ActionCancelled('Cancelled')
async def handle_ClearSession(ctx, msg):
cache.clear()
return Success(message='Session cleared')
@ -62,5 +66,6 @@ async def handle_Ping(ctx, msg):
def boot():
register(wire_types.Initialize, protobuf_workflow, handle_Initialize)
register(wire_types.GetFeatures, protobuf_workflow, handle_GetFeatures)
register(wire_types.Cancel, protobuf_workflow, handle_Cancel)
register(wire_types.ClearSession, protobuf_workflow, handle_ClearSession)
register(wire_types.Ping, protobuf_workflow, handle_Ping)