Skip to content

Commit

Permalink
WIP: expose keyboard layouts for testing
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
mmilata committed Mar 16, 2022
1 parent d80c79c commit fcea751
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions core/src/apps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit fcea751

Please sign in to comment.