From faccce5bd16197dff4cbbba1f67049c465dca766 Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Wed, 6 Jun 2018 17:23:27 +0200 Subject: [PATCH] src/apps/homescreen: handle Cancel --- src/apps/homescreen/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/apps/homescreen/__init__.py b/src/apps/homescreen/__init__.py index e7f8484be2..ac9d0d0b7c 100644 --- a/src/apps/homescreen/__init__.py +++ b/src/apps/homescreen/__init__.py @@ -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)