1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 14:28:07 +00:00

refactor(core/ui): make request_number signature the same in TT and TR

This commit is contained in:
matejcik 2024-02-29 12:13:20 +01:00 committed by matejcik
parent 29863f84ca
commit 99457bbcb0
2 changed files with 10 additions and 2 deletions

View File

@ -157,7 +157,7 @@ where
impl ComponentMsgObj for NumberInput { impl ComponentMsgObj for NumberInput {
fn msg_try_into_obj(&self, msg: Self::Msg) -> Result<Obj, Error> { fn msg_try_into_obj(&self, msg: Self::Msg) -> Result<Obj, Error> {
msg.try_into() (CONFIRMED.as_obj(), msg.try_into()?).try_into()
} }
} }

View File

@ -161,7 +161,15 @@ async def _prompt_number(
ButtonRequestType.ResetDevice, ButtonRequestType.ResetDevice,
) )
return int(result) if __debug__:
if isinstance(result, str):
# debuglink for TR sends a string representing the number
result = CONFIRMED, int(result)
status, value = result
assert status is CONFIRMED
assert isinstance(value, int)
return value
async def slip39_prompt_threshold( async def slip39_prompt_threshold(