From 9f1e066fd2db20e99d9a05a34c08cc2e6b3f097b Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Fri, 4 Mar 2022 12:58:58 +0100 Subject: [PATCH] WIP: expose keyboard layouts for testing [no changelog] --- core/src/apps/base.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/core/src/apps/base.py b/core/src/apps/base.py index 724839a48be..09e1d6cfc2b 100644 --- a/core/src/apps/base.py +++ b/core/src/apps/base.py @@ -148,10 +148,24 @@ async def handle_EndSession(ctx: wire.Context, msg: EndSession) -> Success: async def handle_Ping(ctx: wire.Context, msg: Ping) -> Success: if msg.button_protection: - from trezor.ui.layouts import confirm_action - from trezor.enums import ButtonRequestType as B - - await confirm_action(ctx, "ping", "Confirm", "ping", br_code=B.ProtectCall) + from trezor import log + from trezor.ui.layouts import ( + request_pin_on_device, + request_passphrase_on_device, + ) + from trezor.ui.layouts.tt_v2 import request_word + + layouts = ( + request_pin_on_device(ctx, "Enter PIN", 16, True), + request_passphrase_on_device(ctx, 40), + request_word(ctx, 1, 2, True), + request_word(ctx, 1, 2, False), + ) + for l in layouts: + try: + await l + except Exception as e: + log.exception(__name__, e) return Success(message=msg.message)