1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-21 23:18:13 +00:00

refactor(core): remove confirm_blob unused params

text_mono, info and hold were removed.

[no changelog]
This commit is contained in:
Ioan Bizău 2024-11-21 13:28:41 +01:00
parent 945b9010fa
commit d4081546ba
8 changed files with 1 additions and 43 deletions

View File

@ -742,7 +742,6 @@ static void _librust_qstrs(void) {
MP_QSTR_value;
MP_QSTR_verb;
MP_QSTR_verb_cancel;
MP_QSTR_verb_info;
MP_QSTR_verify;
MP_QSTR_version;
MP_QSTR_warning;

View File

@ -269,7 +269,6 @@ extern "C" fn new_confirm_blob(n_args: usize, args: *const Obj, kwargs: *mut Map
.get(Qstr::MP_QSTR_description)
.unwrap_or_else(|_| Obj::const_none())
.try_into_option()?;
let text_mono: bool = kwargs.get_or(Qstr::MP_QSTR_text_mono, true)?;
let extra: Option<TString> = kwargs
.get(Qstr::MP_QSTR_extra)
.unwrap_or_else(|_| Obj::const_none())
@ -286,10 +285,6 @@ extern "C" fn new_confirm_blob(n_args: usize, args: *const Obj, kwargs: *mut Map
.get(Qstr::MP_QSTR_verb_cancel)
.unwrap_or_else(|_| Obj::const_none())
.try_into_option()?;
let verb_info: Option<TString> = kwargs
.get(Qstr::MP_QSTR_verb_info)
.unwrap_or_else(|_| Obj::const_none())
.try_into_option()?;
let info: bool = kwargs.get_or(Qstr::MP_QSTR_info, true)?;
let hold: bool = kwargs.get_or(Qstr::MP_QSTR_hold, false)?;
let chunkify: bool = kwargs.get_or(Qstr::MP_QSTR_chunkify, false)?;
@ -298,15 +293,10 @@ extern "C" fn new_confirm_blob(n_args: usize, args: *const Obj, kwargs: *mut Map
let cancel: bool = kwargs.get_or(Qstr::MP_QSTR_cancel, false)?;
ConfirmBlobParams::new(title, data, description)
.with_text_mono(text_mono)
.with_subtitle(subtitle)
.with_verb(verb)
.with_verb_cancel(verb_cancel.unwrap_or(TR::buttons__cancel.into()))
.with_verb_info(if info {
Some(verb_info.unwrap_or(TR::words__title_information.into()))
} else {
None
})
.with_verb_info(if info { Some(TR::words__title_information.into()) } else { None })
.with_extra(extra)
.with_chunkify(chunkify)
.with_page_counter(page_counter)
@ -1589,12 +1579,10 @@ pub static mp_module_trezorui2: Module = obj_module! {
/// title: str,
/// data: str | bytes,
/// description: str | None,
/// text_mono: bool = True,
/// extra: str | None = None,
/// subtitle: str | None = None,
/// verb: str | None = None,
/// verb_cancel: str | None = None,
/// verb_info: str | None = None,
/// info: bool = True,
/// hold: bool = False,
/// chunkify: bool = False,

View File

@ -1700,12 +1700,10 @@ pub static mp_module_trezorui2: Module = obj_module! {
/// title: str,
/// data: str | bytes,
/// description: str | None,
/// text_mono: bool = True,
/// extra: str | None = None,
/// subtitle: str | None = None,
/// verb: str = "CONFIRM",
/// verb_cancel: str | None = None,
/// verb_info: str | None = None,
/// info: bool = True,
/// hold: bool = False,
/// chunkify: bool = False,

View File

@ -509,7 +509,6 @@ extern "C" fn new_confirm_blob(n_args: usize, args: *const Obj, kwargs: *mut Map
let data: Obj = kwargs.get(Qstr::MP_QSTR_data)?;
let description: Option<TString> =
kwargs.get(Qstr::MP_QSTR_description)?.try_into_option()?;
let text_mono: bool = kwargs.get_or(Qstr::MP_QSTR_text_mono, true)?;
let extra: Option<TString> = kwargs
.get(Qstr::MP_QSTR_extra)
.unwrap_or_else(|_| Obj::const_none())
@ -527,7 +526,6 @@ extern "C" fn new_confirm_blob(n_args: usize, args: *const Obj, kwargs: *mut Map
let chunkify: bool = kwargs.get_or(Qstr::MP_QSTR_chunkify, false)?;
ConfirmBlobParams::new(title, data, description, verb, verb_cancel, hold)
.with_text_mono(text_mono)
.with_extra(extra)
.with_chunkify(chunkify)
.with_info_button(info)
@ -1781,12 +1779,10 @@ pub static mp_module_trezorui2: Module = obj_module! {
/// title: str,
/// data: str | bytes,
/// description: str | None,
/// text_mono: bool = True,
/// extra: str | None = None,
/// subtitle: str | None = None,
/// verb: str | None = None,
/// verb_cancel: str | None = None,
/// verb_info: str | None = None,
/// info: bool = True,
/// hold: bool = False,
/// chunkify: bool = False,

View File

@ -59,12 +59,10 @@ def confirm_blob(
title: str,
data: str | bytes,
description: str | None,
text_mono: bool = True,
extra: str | None = None,
subtitle: str | None = None,
verb: str | None = None,
verb_cancel: str | None = None,
verb_info: str | None = None,
info: bool = True,
hold: bool = False,
chunkify: bool = False,
@ -636,12 +634,10 @@ def confirm_blob(
title: str,
data: str | bytes,
description: str | None,
text_mono: bool = True,
extra: str | None = None,
subtitle: str | None = None,
verb: str = "CONFIRM",
verb_cancel: str | None = None,
verb_info: str | None = None,
info: bool = True,
hold: bool = False,
chunkify: bool = False,
@ -1208,12 +1204,10 @@ def confirm_blob(
title: str,
data: str | bytes,
description: str | None,
text_mono: bool = True,
extra: str | None = None,
subtitle: str | None = None,
verb: str | None = None,
verb_cancel: str | None = None,
verb_info: str | None = None,
info: bool = True,
hold: bool = False,
chunkify: bool = False,

View File

@ -470,12 +470,9 @@ def confirm_blob(
title: str,
data: bytes | str,
description: str | None = None,
text_mono: bool = True,
subtitle: str | None = None,
verb: str | None = None,
verb_cancel: str | None = None,
info: bool = True,
hold: bool = False,
br_code: ButtonRequestType = BR_CODE_OTHER,
ask_pagination: bool = False,
chunkify: bool = False,
@ -498,7 +495,6 @@ def confirm_blob(
verb=None,
verb_cancel=verb_cancel,
info=False,
hold=False,
chunkify=chunkify,
page_counter=True,
prompt_screen=False,
@ -518,12 +514,9 @@ def confirm_blob(
title=title,
data=data,
description=description,
text_mono=text_mono,
subtitle=subtitle,
verb=verb,
verb_cancel=verb_cancel,
info=info,
hold=hold,
chunkify=chunkify,
prompt_screen=prompt_screen,
)

View File

@ -580,8 +580,6 @@ def confirm_blob(
subtitle: str | None = None,
verb: str | None = None,
verb_cancel: str | None = None, # icon
info: bool = True,
hold: bool = False,
br_code: ButtonRequestType = BR_CODE_OTHER,
ask_pagination: bool = False,
chunkify: bool = False,
@ -594,12 +592,10 @@ def confirm_blob(
data=data,
verb=verb,
verb_cancel="",
hold=hold,
chunkify=chunkify,
)
if ask_pagination and layout.page_count() > 1:
assert not hold
return _confirm_ask_pagination(br_name, title, data, description or "", br_code)
else:
return raise_if_not_confirmed(layout, br_name, br_code)

View File

@ -574,12 +574,9 @@ def confirm_blob(
title: str,
data: bytes | str,
description: str | None = None,
text_mono: bool = True,
subtitle: str | None = None,
verb: str | None = None,
verb_cancel: str | None = None,
info: bool = True,
hold: bool = False,
br_code: ButtonRequestType = BR_CODE_OTHER,
ask_pagination: bool = False,
chunkify: bool = False,
@ -589,16 +586,13 @@ def confirm_blob(
layout = trezorui2.confirm_blob(
title=title,
description=description,
text_mono=text_mono,
data=data,
hold=hold,
verb=verb,
verb_cancel=None,
chunkify=chunkify,
)
if ask_pagination and layout.page_count() > 1:
assert not hold
return _confirm_ask_pagination(br_name, title, data, description or "", br_code)
else:
return raise_if_not_confirmed(