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

23 lines
840 B

import storage.device
from trezor import ui, wire
from trezor.messages import ButtonRequestType
from trezor.messages.GetNextU2FCounter import GetNextU2FCounter
from trezor.messages.NextU2FCounter import NextU2FCounter
from trezor.ui.components.tt.text import Text
from apps.common.confirm import require_confirm
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")
text = Text("Get next U2F counter", ui.ICON_CONFIG)
text.normal("Do you really want to")
text.bold("increase and retrieve")
text.normal("the U2F counter?")
await require_confirm(ctx, text, code=ButtonRequestType.ProtectCall)
return NextU2FCounter(u2f_counter=storage.device.next_u2f_counter())