mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-01 10:20:59 +00:00
refactor(core): move confirm_firmware_update
This commit is contained in:
parent
9b6587c708
commit
a9cf6941c0
@ -69,6 +69,21 @@ extern "C" fn new_confirm_action(n_args: usize, args: *const Obj, kwargs: *mut M
|
|||||||
};
|
};
|
||||||
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
||||||
}
|
}
|
||||||
|
// TODO: there was `no_mangle` attribute in TT, should we apply it?
|
||||||
|
extern "C" fn new_confirm_firmware_update(
|
||||||
|
n_args: usize,
|
||||||
|
args: *const Obj,
|
||||||
|
kwargs: *mut Map,
|
||||||
|
) -> Obj {
|
||||||
|
let block = move |_args: &[Obj], kwargs: &Map| {
|
||||||
|
let description: TString = kwargs.get(Qstr::MP_QSTR_description)?.try_into()?;
|
||||||
|
let fingerprint: TString = kwargs.get(Qstr::MP_QSTR_fingerprint)?.try_into()?;
|
||||||
|
|
||||||
|
let layout = ModelUI::confirm_firmware_update(description, fingerprint)?;
|
||||||
|
Ok(LayoutObj::new_root(layout)?.into())
|
||||||
|
};
|
||||||
|
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" fn new_request_bip39(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj {
|
extern "C" fn new_request_bip39(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj {
|
||||||
let block = move |_args: &[Obj], kwargs: &Map| {
|
let block = move |_args: &[Obj], kwargs: &Map| {
|
||||||
@ -286,6 +301,14 @@ pub static mp_module_trezorui_api: Module = obj_module! {
|
|||||||
/// """Confirm action."""
|
/// """Confirm action."""
|
||||||
Qstr::MP_QSTR_confirm_action => obj_fn_kw!(0, new_confirm_action).as_obj(),
|
Qstr::MP_QSTR_confirm_action => obj_fn_kw!(0, new_confirm_action).as_obj(),
|
||||||
|
|
||||||
|
/// def confirm_firmware_update(
|
||||||
|
/// *,
|
||||||
|
/// description: str,
|
||||||
|
/// fingerprint: str,
|
||||||
|
/// ) -> LayoutObj[UiResult]:
|
||||||
|
/// """Ask whether to update firmware, optionally show fingerprint."""
|
||||||
|
Qstr::MP_QSTR_confirm_firmware_update => obj_fn_kw!(0, new_confirm_firmware_update).as_obj(),
|
||||||
|
|
||||||
/// def request_bip39(
|
/// def request_bip39(
|
||||||
/// *,
|
/// *,
|
||||||
/// prompt: str,
|
/// prompt: str,
|
||||||
|
@ -392,22 +392,6 @@ extern "C" fn new_confirm_address(n_args: usize, args: *const Obj, kwargs: *mut
|
|||||||
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" fn new_confirm_firmware_update(
|
|
||||||
n_args: usize,
|
|
||||||
args: *const Obj,
|
|
||||||
kwargs: *mut Map,
|
|
||||||
) -> Obj {
|
|
||||||
let block = move |_args: &[Obj], kwargs: &Map| {
|
|
||||||
let description: TString = kwargs.get(Qstr::MP_QSTR_description)?.try_into()?;
|
|
||||||
let fingerprint: TString = kwargs.get(Qstr::MP_QSTR_fingerprint)?.try_into()?;
|
|
||||||
|
|
||||||
let flow =
|
|
||||||
flow::confirm_firmware_update::new_confirm_firmware_update(description, fingerprint)?;
|
|
||||||
Ok(LayoutObj::new_root(flow)?.into())
|
|
||||||
};
|
|
||||||
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" fn new_confirm_properties(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj {
|
extern "C" fn new_confirm_properties(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj {
|
||||||
let block = move |_args: &[Obj], kwargs: &Map| {
|
let block = move |_args: &[Obj], kwargs: &Map| {
|
||||||
let title: TString = kwargs.get(Qstr::MP_QSTR_title)?.try_into()?;
|
let title: TString = kwargs.get(Qstr::MP_QSTR_title)?.try_into()?;
|
||||||
@ -1717,14 +1701,6 @@ pub static mp_module_trezorui2: Module = obj_module! {
|
|||||||
/// """Homescreen for locked device."""
|
/// """Homescreen for locked device."""
|
||||||
Qstr::MP_QSTR_show_lockscreen => obj_fn_kw!(0, new_show_lockscreen).as_obj(),
|
Qstr::MP_QSTR_show_lockscreen => obj_fn_kw!(0, new_show_lockscreen).as_obj(),
|
||||||
|
|
||||||
/// def confirm_firmware_update(
|
|
||||||
/// *,
|
|
||||||
/// description: str,
|
|
||||||
/// fingerprint: str,
|
|
||||||
/// ) -> LayoutObj[UiResult]:
|
|
||||||
/// """Ask whether to update firmware, optionally show fingerprint."""
|
|
||||||
Qstr::MP_QSTR_confirm_firmware_update => obj_fn_kw!(0, new_confirm_firmware_update).as_obj(),
|
|
||||||
|
|
||||||
/// def tutorial() -> LayoutObj[UiResult]:
|
/// def tutorial() -> LayoutObj[UiResult]:
|
||||||
/// """Show user how to interact with the device."""
|
/// """Show user how to interact with the device."""
|
||||||
Qstr::MP_QSTR_tutorial => obj_fn_0!(new_show_tutorial).as_obj(),
|
Qstr::MP_QSTR_tutorial => obj_fn_0!(new_show_tutorial).as_obj(),
|
||||||
|
@ -54,6 +54,15 @@ impl UIFeaturesFirmware for ModelMercuryFeatures {
|
|||||||
Ok(flow)
|
Ok(flow)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn confirm_firmware_update(
|
||||||
|
description: TString<'static>,
|
||||||
|
fingerprint: TString<'static>,
|
||||||
|
) -> Result<impl LayoutMaybeTrace, Error> {
|
||||||
|
let flow =
|
||||||
|
flow::confirm_firmware_update::new_confirm_firmware_update(description, fingerprint)?;
|
||||||
|
Ok(flow)
|
||||||
|
}
|
||||||
|
|
||||||
fn check_homescreen_format(image: BinaryData, __accept_toif: bool) -> bool {
|
fn check_homescreen_format(image: BinaryData, __accept_toif: bool) -> bool {
|
||||||
super::component::check_homescreen_format(image)
|
super::component::check_homescreen_format(image)
|
||||||
}
|
}
|
||||||
|
@ -1423,43 +1423,6 @@ extern "C" fn new_show_lockscreen(n_args: usize, args: *const Obj, kwargs: *mut
|
|||||||
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" fn new_confirm_firmware_update(
|
|
||||||
n_args: usize,
|
|
||||||
args: *const Obj,
|
|
||||||
kwargs: *mut Map,
|
|
||||||
) -> Obj {
|
|
||||||
use super::component::bl_confirm::Confirm;
|
|
||||||
let block = move |_args: &[Obj], kwargs: &Map| {
|
|
||||||
let description: TString = kwargs.get(Qstr::MP_QSTR_description)?.try_into()?;
|
|
||||||
let fingerprint: TString = kwargs.get(Qstr::MP_QSTR_fingerprint)?.try_into()?;
|
|
||||||
|
|
||||||
let title = TR::firmware_update__title;
|
|
||||||
let message = Label::left_aligned(description, theme::TEXT_NORMAL).vertically_centered();
|
|
||||||
let fingerprint = Label::left_aligned(
|
|
||||||
fingerprint,
|
|
||||||
theme::TEXT_NORMAL.with_line_breaking(LineBreaking::BreakWordsNoHyphen),
|
|
||||||
)
|
|
||||||
.vertically_centered();
|
|
||||||
|
|
||||||
let obj = LayoutObj::new(
|
|
||||||
Confirm::new(
|
|
||||||
theme::BG,
|
|
||||||
title.into(),
|
|
||||||
message,
|
|
||||||
None,
|
|
||||||
TR::buttons__install.as_tstring(),
|
|
||||||
false,
|
|
||||||
)
|
|
||||||
.with_info_screen(
|
|
||||||
TR::firmware_update__title_fingerprint.as_tstring(),
|
|
||||||
fingerprint,
|
|
||||||
),
|
|
||||||
)?;
|
|
||||||
Ok(obj.into())
|
|
||||||
};
|
|
||||||
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" fn new_show_wait_text(message: Obj) -> Obj {
|
extern "C" fn new_show_wait_text(message: Obj) -> Obj {
|
||||||
let block = || {
|
let block = || {
|
||||||
let message: TString<'static> = message.try_into()?;
|
let message: TString<'static> = message.try_into()?;
|
||||||
@ -1799,14 +1762,6 @@ pub static mp_module_trezorui2: Module = obj_module! {
|
|||||||
/// """Homescreen for locked device."""
|
/// """Homescreen for locked device."""
|
||||||
Qstr::MP_QSTR_show_lockscreen => obj_fn_kw!(0, new_show_lockscreen).as_obj(),
|
Qstr::MP_QSTR_show_lockscreen => obj_fn_kw!(0, new_show_lockscreen).as_obj(),
|
||||||
|
|
||||||
/// def confirm_firmware_update(
|
|
||||||
/// *,
|
|
||||||
/// description: str,
|
|
||||||
/// fingerprint: str,
|
|
||||||
/// ) -> LayoutObj[UiResult]:
|
|
||||||
/// """Ask whether to update firmware, optionally show fingerprint. Shared with bootloader."""
|
|
||||||
Qstr::MP_QSTR_confirm_firmware_update => obj_fn_kw!(0, new_confirm_firmware_update).as_obj(),
|
|
||||||
|
|
||||||
/// def show_wait_text(message: str, /) -> None:
|
/// def show_wait_text(message: str, /) -> None:
|
||||||
/// """Show single-line text in the middle of the screen."""
|
/// """Show single-line text in the middle of the screen."""
|
||||||
Qstr::MP_QSTR_show_wait_text => obj_fn_1!(new_show_wait_text).as_obj(),
|
Qstr::MP_QSTR_show_wait_text => obj_fn_1!(new_show_wait_text).as_obj(),
|
||||||
|
@ -8,7 +8,7 @@ use crate::{
|
|||||||
ui::{
|
ui::{
|
||||||
component::{
|
component::{
|
||||||
text::paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt},
|
text::paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt},
|
||||||
Component, ComponentExt, Paginate, Timeout,
|
Component, ComponentExt, Label, LineBreaking, Paginate, Timeout,
|
||||||
},
|
},
|
||||||
layout::{
|
layout::{
|
||||||
obj::{LayoutMaybeTrace, LayoutObj, RootComponent},
|
obj::{LayoutMaybeTrace, LayoutObj, RootComponent},
|
||||||
@ -67,6 +67,36 @@ impl UIFeaturesFirmware for ModelTRFeatures {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn confirm_firmware_update(
|
||||||
|
description: TString<'static>,
|
||||||
|
fingerprint: TString<'static>,
|
||||||
|
) -> Result<impl LayoutMaybeTrace, Error> {
|
||||||
|
use super::component::bl_confirm::Confirm;
|
||||||
|
let title = TR::firmware_update__title;
|
||||||
|
let message = Label::left_aligned(description, theme::TEXT_NORMAL).vertically_centered();
|
||||||
|
let fingerprint = Label::left_aligned(
|
||||||
|
fingerprint,
|
||||||
|
theme::TEXT_NORMAL.with_line_breaking(LineBreaking::BreakWordsNoHyphen),
|
||||||
|
)
|
||||||
|
.vertically_centered();
|
||||||
|
|
||||||
|
let layout = RootComponent::new(
|
||||||
|
Confirm::new(
|
||||||
|
theme::BG,
|
||||||
|
title.into(),
|
||||||
|
message,
|
||||||
|
None,
|
||||||
|
TR::buttons__install.as_tstring(),
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
.with_info_screen(
|
||||||
|
TR::firmware_update__title_fingerprint.as_tstring(),
|
||||||
|
fingerprint,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
Ok(layout)
|
||||||
|
}
|
||||||
|
|
||||||
fn check_homescreen_format(image: BinaryData, _accept_toif: bool) -> bool {
|
fn check_homescreen_format(image: BinaryData, _accept_toif: bool) -> bool {
|
||||||
super::component::check_homescreen_format(image)
|
super::component::check_homescreen_format(image)
|
||||||
}
|
}
|
||||||
|
@ -1419,36 +1419,6 @@ extern "C" fn new_show_lockscreen(n_args: usize, args: *const Obj, kwargs: *mut
|
|||||||
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
|
||||||
extern "C" fn new_confirm_firmware_update(
|
|
||||||
n_args: usize,
|
|
||||||
args: *const Obj,
|
|
||||||
kwargs: *mut Map,
|
|
||||||
) -> Obj {
|
|
||||||
use super::component::bl_confirm::{Confirm, ConfirmTitle};
|
|
||||||
let block = move |_args: &[Obj], kwargs: &Map| {
|
|
||||||
let description: TString = kwargs.get(Qstr::MP_QSTR_description)?.try_into()?;
|
|
||||||
let fingerprint: TString = kwargs.get(Qstr::MP_QSTR_fingerprint)?.try_into()?;
|
|
||||||
|
|
||||||
let title_str = TR::firmware_update__title.into();
|
|
||||||
let title = Label::left_aligned(title_str, theme::TEXT_BOLD).vertically_centered();
|
|
||||||
let msg = Label::left_aligned(description, theme::TEXT_NORMAL);
|
|
||||||
|
|
||||||
let left = Button::with_text(TR::buttons__cancel.into()).styled(theme::button_default());
|
|
||||||
let right = Button::with_text(TR::buttons__install.into()).styled(theme::button_confirm());
|
|
||||||
|
|
||||||
let obj = LayoutObj::new(
|
|
||||||
Confirm::new(theme::BG, left, right, ConfirmTitle::Text(title), msg).with_info(
|
|
||||||
TR::firmware_update__title_fingerprint.into(),
|
|
||||||
fingerprint,
|
|
||||||
theme::button_moreinfo(),
|
|
||||||
),
|
|
||||||
)?;
|
|
||||||
Ok(obj.into())
|
|
||||||
};
|
|
||||||
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" fn new_show_wait_text(message: Obj) -> Obj {
|
extern "C" fn new_show_wait_text(message: Obj) -> Obj {
|
||||||
let block = || {
|
let block = || {
|
||||||
let message: TString<'static> = message.try_into()?;
|
let message: TString<'static> = message.try_into()?;
|
||||||
@ -1801,14 +1771,6 @@ pub static mp_module_trezorui2: Module = obj_module! {
|
|||||||
/// """Homescreen for locked device."""
|
/// """Homescreen for locked device."""
|
||||||
Qstr::MP_QSTR_show_lockscreen => obj_fn_kw!(0, new_show_lockscreen).as_obj(),
|
Qstr::MP_QSTR_show_lockscreen => obj_fn_kw!(0, new_show_lockscreen).as_obj(),
|
||||||
|
|
||||||
/// def confirm_firmware_update(
|
|
||||||
/// *,
|
|
||||||
/// description: str,
|
|
||||||
/// fingerprint: str,
|
|
||||||
/// ) -> LayoutObj[UiResult]:
|
|
||||||
/// """Ask whether to update firmware, optionally show fingerprint. Shared with bootloader."""
|
|
||||||
Qstr::MP_QSTR_confirm_firmware_update => obj_fn_kw!(0, new_confirm_firmware_update).as_obj(),
|
|
||||||
|
|
||||||
/// def show_wait_text(message: str, /) -> LayoutObj[None]:
|
/// def show_wait_text(message: str, /) -> LayoutObj[None]:
|
||||||
/// """Show single-line text in the middle of the screen."""
|
/// """Show single-line text in the middle of the screen."""
|
||||||
Qstr::MP_QSTR_show_wait_text => obj_fn_1!(new_show_wait_text).as_obj(),
|
Qstr::MP_QSTR_show_wait_text => obj_fn_1!(new_show_wait_text).as_obj(),
|
||||||
|
@ -6,9 +6,7 @@ use crate::{
|
|||||||
translations::TR,
|
translations::TR,
|
||||||
ui::{
|
ui::{
|
||||||
component::{
|
component::{
|
||||||
image::BlendedImage,
|
image::BlendedImage, text::paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt}, ComponentExt, Empty, Label, Timeout
|
||||||
text::paragraphs::{Paragraph, ParagraphSource, ParagraphVecShort, Paragraphs, VecExt},
|
|
||||||
ComponentExt, Empty, Timeout,
|
|
||||||
},
|
},
|
||||||
layout::{
|
layout::{
|
||||||
obj::{LayoutMaybeTrace, LayoutObj, RootComponent},
|
obj::{LayoutMaybeTrace, LayoutObj, RootComponent},
|
||||||
@ -69,6 +67,29 @@ impl UIFeaturesFirmware for ModelTTFeatures {
|
|||||||
Ok(layout)
|
Ok(layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn confirm_firmware_update(
|
||||||
|
description: TString<'static>,
|
||||||
|
fingerprint: TString<'static>,
|
||||||
|
) -> Result<impl LayoutMaybeTrace, Error> {
|
||||||
|
use super::component::bl_confirm::{Confirm, ConfirmTitle};
|
||||||
|
|
||||||
|
let title_str = TR::firmware_update__title.into();
|
||||||
|
let title = Label::left_aligned(title_str, theme::TEXT_BOLD).vertically_centered();
|
||||||
|
let msg = Label::left_aligned(description, theme::TEXT_NORMAL);
|
||||||
|
|
||||||
|
let left = Button::with_text(TR::buttons__cancel.into()).styled(theme::button_default());
|
||||||
|
let right = Button::with_text(TR::buttons__install.into()).styled(theme::button_confirm());
|
||||||
|
|
||||||
|
let layout = RootComponent::new(
|
||||||
|
Confirm::new(theme::BG, left, right, ConfirmTitle::Text(title), msg).with_info(
|
||||||
|
TR::firmware_update__title_fingerprint.into(),
|
||||||
|
fingerprint,
|
||||||
|
theme::button_moreinfo(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
Ok(layout)
|
||||||
|
}
|
||||||
|
|
||||||
fn check_homescreen_format(image: BinaryData, accept_toif: bool) -> bool {
|
fn check_homescreen_format(image: BinaryData, accept_toif: bool) -> bool {
|
||||||
super::component::check_homescreen_format(image, false)
|
super::component::check_homescreen_format(image, false)
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,11 @@ pub trait UIFeaturesFirmware {
|
|||||||
prompt_title: Option<TString<'static>>,
|
prompt_title: Option<TString<'static>>,
|
||||||
) -> Result<impl LayoutMaybeTrace, Error>;
|
) -> Result<impl LayoutMaybeTrace, Error>;
|
||||||
|
|
||||||
|
fn confirm_firmware_update(
|
||||||
|
description: TString<'static>,
|
||||||
|
fingerprint: TString<'static>,
|
||||||
|
) -> Result<impl LayoutMaybeTrace, Error>;
|
||||||
|
|
||||||
fn check_homescreen_format(image: BinaryData, accept_toif: bool) -> bool;
|
fn check_homescreen_format(image: BinaryData, accept_toif: bool) -> bool;
|
||||||
|
|
||||||
fn request_bip39(
|
fn request_bip39(
|
||||||
|
@ -369,15 +369,6 @@ def show_lockscreen(
|
|||||||
"""Homescreen for locked device."""
|
"""Homescreen for locked device."""
|
||||||
|
|
||||||
|
|
||||||
# rust/src/ui/model_mercury/layout.rs
|
|
||||||
def confirm_firmware_update(
|
|
||||||
*,
|
|
||||||
description: str,
|
|
||||||
fingerprint: str,
|
|
||||||
) -> LayoutObj[UiResult]:
|
|
||||||
"""Ask whether to update firmware, optionally show fingerprint."""
|
|
||||||
|
|
||||||
|
|
||||||
# rust/src/ui/model_mercury/layout.rs
|
# rust/src/ui/model_mercury/layout.rs
|
||||||
def tutorial() -> LayoutObj[UiResult]:
|
def tutorial() -> LayoutObj[UiResult]:
|
||||||
"""Show user how to interact with the device."""
|
"""Show user how to interact with the device."""
|
||||||
@ -814,15 +805,6 @@ def show_lockscreen(
|
|||||||
"""Homescreen for locked device."""
|
"""Homescreen for locked device."""
|
||||||
|
|
||||||
|
|
||||||
# rust/src/ui/model_tr/layout.rs
|
|
||||||
def confirm_firmware_update(
|
|
||||||
*,
|
|
||||||
description: str,
|
|
||||||
fingerprint: str,
|
|
||||||
) -> LayoutObj[UiResult]:
|
|
||||||
"""Ask whether to update firmware, optionally show fingerprint. Shared with bootloader."""
|
|
||||||
|
|
||||||
|
|
||||||
# rust/src/ui/model_tr/layout.rs
|
# rust/src/ui/model_tr/layout.rs
|
||||||
def show_wait_text(message: str, /) -> None:
|
def show_wait_text(message: str, /) -> None:
|
||||||
"""Show single-line text in the middle of the screen."""
|
"""Show single-line text in the middle of the screen."""
|
||||||
@ -1197,15 +1179,6 @@ def show_lockscreen(
|
|||||||
"""Homescreen for locked device."""
|
"""Homescreen for locked device."""
|
||||||
|
|
||||||
|
|
||||||
# rust/src/ui/model_tt/layout.rs
|
|
||||||
def confirm_firmware_update(
|
|
||||||
*,
|
|
||||||
description: str,
|
|
||||||
fingerprint: str,
|
|
||||||
) -> LayoutObj[UiResult]:
|
|
||||||
"""Ask whether to update firmware, optionally show fingerprint. Shared with bootloader."""
|
|
||||||
|
|
||||||
|
|
||||||
# rust/src/ui/model_tt/layout.rs
|
# rust/src/ui/model_tt/layout.rs
|
||||||
def show_wait_text(message: str, /) -> LayoutObj[None]:
|
def show_wait_text(message: str, /) -> LayoutObj[None]:
|
||||||
"""Show single-line text in the middle of the screen."""
|
"""Show single-line text in the middle of the screen."""
|
||||||
|
@ -96,6 +96,15 @@ def confirm_action(
|
|||||||
"""Confirm action."""
|
"""Confirm action."""
|
||||||
|
|
||||||
|
|
||||||
|
# rust/src/ui/api/firmware_upy.rs
|
||||||
|
def confirm_firmware_update(
|
||||||
|
*,
|
||||||
|
description: str,
|
||||||
|
fingerprint: str,
|
||||||
|
) -> LayoutObj[UiResult]:
|
||||||
|
"""Ask whether to update firmware, optionally show fingerprint."""
|
||||||
|
|
||||||
|
|
||||||
# rust/src/ui/api/firmware_upy.rs
|
# rust/src/ui/api/firmware_upy.rs
|
||||||
def request_bip39(
|
def request_bip39(
|
||||||
*,
|
*,
|
||||||
|
@ -1183,7 +1183,7 @@ def confirm_set_new_pin(
|
|||||||
|
|
||||||
def confirm_firmware_update(description: str, fingerprint: str) -> Awaitable[None]:
|
def confirm_firmware_update(description: str, fingerprint: str) -> Awaitable[None]:
|
||||||
return raise_if_not_confirmed(
|
return raise_if_not_confirmed(
|
||||||
trezorui2.confirm_firmware_update(
|
trezorui_api.confirm_firmware_update(
|
||||||
description=description, fingerprint=fingerprint
|
description=description, fingerprint=fingerprint
|
||||||
),
|
),
|
||||||
"firmware_update",
|
"firmware_update",
|
||||||
|
@ -1296,7 +1296,7 @@ async def confirm_set_new_pin(
|
|||||||
|
|
||||||
def confirm_firmware_update(description: str, fingerprint: str) -> Awaitable[None]:
|
def confirm_firmware_update(description: str, fingerprint: str) -> Awaitable[None]:
|
||||||
return raise_if_not_confirmed(
|
return raise_if_not_confirmed(
|
||||||
trezorui2.confirm_firmware_update(
|
trezorui_api.confirm_firmware_update(
|
||||||
description=description, fingerprint=fingerprint
|
description=description, fingerprint=fingerprint
|
||||||
),
|
),
|
||||||
"firmware_update",
|
"firmware_update",
|
||||||
|
@ -1252,7 +1252,7 @@ def confirm_set_new_pin(
|
|||||||
|
|
||||||
def confirm_firmware_update(description: str, fingerprint: str) -> Awaitable[None]:
|
def confirm_firmware_update(description: str, fingerprint: str) -> Awaitable[None]:
|
||||||
return raise_if_not_confirmed(
|
return raise_if_not_confirmed(
|
||||||
trezorui2.confirm_firmware_update(
|
trezorui_api.confirm_firmware_update(
|
||||||
description=description, fingerprint=fingerprint
|
description=description, fingerprint=fingerprint
|
||||||
),
|
),
|
||||||
"firmware_update",
|
"firmware_update",
|
||||||
|
Loading…
Reference in New Issue
Block a user