diff --git a/core/embed/rust/librust_qstr.h b/core/embed/rust/librust_qstr.h index b1b76b9fe9..67e7661e5c 100644 --- a/core/embed/rust/librust_qstr.h +++ b/core/embed/rust/librust_qstr.h @@ -50,7 +50,6 @@ static void _librust_qstrs(void) { MP_QSTR_request_pin; MP_QSTR_request_passphrase; MP_QSTR_confirm_word; - MP_QSTR_pin_confirm_action; MP_QSTR_request_bip39; MP_QSTR_request_number; MP_QSTR_request_passphrase; diff --git a/core/embed/rust/src/ui/model_tr/layout.rs b/core/embed/rust/src/ui/model_tr/layout.rs index 96c09f5ba4..bc598f3cf7 100644 --- a/core/embed/rust/src/ui/model_tr/layout.rs +++ b/core/embed/rust/src/ui/model_tr/layout.rs @@ -409,47 +409,6 @@ extern "C" fn tutorial(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) } } -extern "C" fn pin_confirm_action(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj { - let block = |_args: &[Obj], kwargs: &Map| { - let action: StrBuffer = kwargs.get(Qstr::MP_QSTR_action)?.try_into()?; - - let get_page = move |page_index| { - let screen = match page_index { - // title, text, btn_layout, btn_actions - // NOTE: doing the newlines manually to look exactly same - // as in the design. - 0 => ( - "PIN settings".into(), - "PIN should contain at least 6 digits", - ButtonLayout::cancel_and_text("GOT IT"), - ButtonActions::cancel_next(), - ), - 1 => ( - action.clone(), - "You'll use\nthis PIN to\naccess this\ndevice.", - ButtonLayout::cancel_and_htc_text( - "HOLD TO CONFIRM", - Duration::from_millis(1000), - ), - ButtonActions::cancel_confirm(), - ), - _ => unreachable!(), - }; - - Page::<10>::new(screen.2.clone(), screen.3.clone(), Font::BOLD) - .text_bold(screen.0) - .newline() - .newline_half() - .text_mono(screen.1.into()) - }; - let pages = FlowPages::new(get_page, 2); - - let obj = LayoutObj::new(Flow::new(pages).into_child())?; - Ok(obj.into()) - }; - unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) } -} - extern "C" fn request_pin(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj { let block = |_args: &[Obj], kwargs: &Map| { let prompt: StrBuffer = kwargs.get(Qstr::MP_QSTR_prompt)?.try_into()?; @@ -590,10 +549,6 @@ pub static mp_module_trezorui2: Module = obj_module! { /// """Show user how to interact with the device.""" Qstr::MP_QSTR_tutorial => obj_fn_kw!(0, tutorial).as_obj(), - /// def pin_confirm_action(*, action: str) -> object: - /// """Confirm PIN action and informing user about it.""" - Qstr::MP_QSTR_pin_confirm_action => obj_fn_kw!(0, pin_confirm_action).as_obj(), - /// def request_pin( /// *, /// prompt: str, diff --git a/core/mocks/generated/trezorui2.pyi b/core/mocks/generated/trezorui2.pyi index d62fb6afd7..3b7d72eb46 100644 --- a/core/mocks/generated/trezorui2.pyi +++ b/core/mocks/generated/trezorui2.pyi @@ -83,11 +83,6 @@ def tutorial() -> object: """Show user how to interact with the device.""" -# rust/src/ui/model_tr/layout.rs -def pin_confirm_action(*, action: str) -> object: - """Confirm PIN action and informing user about it.""" - - # rust/src/ui/model_tr/layout.rs def request_pin( *, diff --git a/core/src/trezor/ui/layouts/tr/__init__.py b/core/src/trezor/ui/layouts/tr/__init__.py index b39fcc1ca9..8ee4128a8e 100644 --- a/core/src/trezor/ui/layouts/tr/__init__.py +++ b/core/src/trezor/ui/layouts/tr/__init__.py @@ -510,36 +510,6 @@ async def confirm_action( ) -async def pin_confirm_action( - ctx: wire.GenericContext, - br_type: str, - action: str, - exc: ExceptionType = wire.ActionCancelled, - br_code: ButtonRequestType = ButtonRequestType.Other, -) -> None: - """Custom layout for PIN confirmation. - - Contains some additional information about PIN, - divided into two screens with different buttons. - """ - # Making the first letter in action upper - # There is no capitalize() method in micropython - action = action[0].upper() + action[1:] - await raise_if_cancelled( - interact( - ctx, - RustLayout( - trezorui2.pin_confirm_action( - action=action, - ) - ), - br_type, - br_code, - ), - exc, - ) - - async def confirm_reset_device( ctx: wire.GenericContext, prompt: str,