mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-26 00:18:15 +00:00
fixup! wip
This commit is contained in:
parent
f08d65eb43
commit
f1f2852bbc
@ -98,7 +98,7 @@ async def handle_pairing_request(
|
|||||||
|
|
||||||
ctx.host_name = message.host_name
|
ctx.host_name = message.host_name
|
||||||
if __debug__ and not ctx.channel_ctx.should_show_pairing_dialog:
|
if __debug__ and not ctx.channel_ctx.should_show_pairing_dialog:
|
||||||
_skip_pairing_dialog(ctx)
|
await _skip_pairing_dialog(ctx)
|
||||||
else:
|
else:
|
||||||
await ctx.show_pairing_dialog()
|
await ctx.show_pairing_dialog()
|
||||||
assert ThpSelectMethod.MESSAGE_WIRE_TYPE is not None
|
assert ThpSelectMethod.MESSAGE_WIRE_TYPE is not None
|
||||||
@ -493,6 +493,7 @@ def _get_message_type_for_method(method: int) -> int:
|
|||||||
return ThpMessageType.ThpQrCodeTag
|
return ThpMessageType.ThpQrCodeTag
|
||||||
raise ValueError("Unexpected pairing method - no message type available")
|
raise ValueError("Unexpected pairing method - no message type available")
|
||||||
|
|
||||||
|
|
||||||
if __debug__:
|
if __debug__:
|
||||||
|
|
||||||
async def _skip_pairing_dialog(ctx: PairingContext) -> None:
|
async def _skip_pairing_dialog(ctx: PairingContext) -> None:
|
||||||
@ -501,7 +502,8 @@ if __debug__:
|
|||||||
from trezor.wire.errors import ActionCancelled
|
from trezor.wire.errors import ActionCancelled
|
||||||
|
|
||||||
resp = await ctx.call(
|
resp = await ctx.call(
|
||||||
ButtonRequest(code=ButtonRequestType.Other, name="thp_pairing_request")
|
ButtonRequest(code=ButtonRequestType.Other, name="thp_pairing_request"),
|
||||||
|
expected_type=ButtonAck,
|
||||||
)
|
)
|
||||||
if isinstance(resp, ButtonAck):
|
if isinstance(resp, ButtonAck):
|
||||||
await ctx.write(ThpPairingRequestApproved())
|
await ctx.write(ThpPairingRequestApproved())
|
||||||
|
Loading…
Reference in New Issue
Block a user