mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-09 15:00:58 +00:00
src/apps/{common,management}: use more specific ButtonRequestTypes
This commit is contained in:
parent
f6e06b768d
commit
85e5a87c24
@ -18,7 +18,7 @@ async def request_passphrase_entry(ctx):
|
|||||||
text.render()
|
text.render()
|
||||||
|
|
||||||
ack = await ctx.call(
|
ack = await ctx.call(
|
||||||
ButtonRequest(code=ButtonRequestType.Other),
|
ButtonRequest(code=ButtonRequestType.PassphraseType),
|
||||||
wire_types.ButtonAck,
|
wire_types.ButtonAck,
|
||||||
wire_types.Cancel)
|
wire_types.Cancel)
|
||||||
if ack.MESSAGE_WIRE_TYPE == wire_types.Cancel:
|
if ack.MESSAGE_WIRE_TYPE == wire_types.Cancel:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from trezor import config, ui, wire
|
from trezor import config, ui, wire
|
||||||
from trezor.crypto import bip39
|
from trezor.crypto import bip39
|
||||||
from trezor.messages.ButtonRequest import ButtonRequest
|
from trezor.messages.ButtonRequest import ButtonRequest
|
||||||
from trezor.messages.ButtonRequestType import Other
|
from trezor.messages.ButtonRequestType import MnemonicWordCount, MnemonicInput
|
||||||
from trezor.messages.FailureType import ProcessError, UnexpectedMessage
|
from trezor.messages.FailureType import ProcessError, UnexpectedMessage
|
||||||
from trezor.messages.Success import Success
|
from trezor.messages.Success import Success
|
||||||
from trezor.messages.wire_types import ButtonAck
|
from trezor.messages.wire_types import ButtonAck
|
||||||
@ -56,7 +56,7 @@ async def recovery_device(ctx, msg):
|
|||||||
|
|
||||||
@ui.layout
|
@ui.layout
|
||||||
async def request_wordcount(ctx):
|
async def request_wordcount(ctx):
|
||||||
await ctx.call(ButtonRequest(code=Other), ButtonAck)
|
await ctx.call(ButtonRequest(code=MnemonicWordCount), ButtonAck)
|
||||||
|
|
||||||
content = Text('Device recovery', ui.ICON_RECOVERY, 'Number of words?')
|
content = Text('Device recovery', ui.ICON_RECOVERY, 'Number of words?')
|
||||||
select = WordSelector(content)
|
select = WordSelector(content)
|
||||||
@ -67,7 +67,7 @@ async def request_wordcount(ctx):
|
|||||||
|
|
||||||
@ui.layout
|
@ui.layout
|
||||||
async def request_mnemonic(ctx, count: int) -> str:
|
async def request_mnemonic(ctx, count: int) -> str:
|
||||||
await ctx.call(ButtonRequest(code=Other), ButtonAck)
|
await ctx.call(ButtonRequest(code=MnemonicInput), ButtonAck)
|
||||||
|
|
||||||
words = []
|
words = []
|
||||||
board = MnemonicKeyboard()
|
board = MnemonicKeyboard()
|
||||||
|
Loading…
Reference in New Issue
Block a user