You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/src/apps/management/get_next_u2f_counter.py

24 lines
754 B

import storage.device
from trezor import ui, wire
from trezor.enums import ButtonRequestType
from trezor.messages import GetNextU2FCounter, NextU2FCounter
from trezor.ui.layouts import confirm_action
async def get_next_u2f_counter(
ctx: wire.Context, msg: GetNextU2FCounter
) -> NextU2FCounter:
if not storage.device.is_initialized():
raise wire.NotInitialized("Device is not initialized")
await confirm_action(
ctx,
"get_u2f_counter",
title="Get next U2F counter",
description="Do you really want to increase and retrieve\nthe U2F counter?",
icon=ui.ICON_CONFIG,
br_code=ButtonRequestType.ProtectCall,
)
return NextU2FCounter(u2f_counter=storage.device.next_u2f_counter())