From 627ef9748f436ec7c2f67d81f34fcb0ee1c98f1b Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Mon, 24 Oct 2022 20:02:37 +0200 Subject: [PATCH] feat(core): Remove coin name from CoinJoin confirmation dialog. [no changelog] --- core/embed/rust/src/ui/model_tt/layout.rs | 4 ---- core/mocks/generated/trezorui2.pyi | 1 - core/src/apps/bitcoin/authorize_coinjoin.py | 2 +- core/src/trezor/ui/layouts/tt/__init__.py | 5 +---- core/src/trezor/ui/layouts/tt_v2/__init__.py | 3 +-- 5 files changed, 3 insertions(+), 12 deletions(-) diff --git a/core/embed/rust/src/ui/model_tt/layout.rs b/core/embed/rust/src/ui/model_tt/layout.rs index e457ec039a..739c8c66b8 100644 --- a/core/embed/rust/src/ui/model_tt/layout.rs +++ b/core/embed/rust/src/ui/model_tt/layout.rs @@ -776,13 +776,10 @@ extern "C" fn new_confirm_with_info(n_args: usize, args: *const Obj, kwargs: *mu extern "C" fn new_confirm_coinjoin(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj { let block = move |_args: &[Obj], kwargs: &Map| { - let coin_name: StrBuffer = kwargs.get(Qstr::MP_QSTR_coin_name)?.try_into()?; let max_rounds: StrBuffer = kwargs.get(Qstr::MP_QSTR_max_rounds)?.try_into()?; let max_feerate: StrBuffer = kwargs.get(Qstr::MP_QSTR_max_feerate)?.try_into()?; let paragraphs = Paragraphs::new([ - Paragraph::new(&theme::TEXT_NORMAL, "Coin name:".into()), - Paragraph::new(&theme::TEXT_BOLD, coin_name), Paragraph::new(&theme::TEXT_NORMAL, "Maximum rounds:".into()), Paragraph::new(&theme::TEXT_BOLD, max_rounds), Paragraph::new(&theme::TEXT_NORMAL, "Maximum mining fee:".into()), @@ -1263,7 +1260,6 @@ pub static mp_module_trezorui2: Module = obj_module! { /// def confirm_coinjoin( /// *, - /// coin_name: str, /// max_rounds: str, /// max_feerate: str, /// ) -> object: diff --git a/core/mocks/generated/trezorui2.pyi b/core/mocks/generated/trezorui2.pyi index da06e42d67..7f3ac28159 100644 --- a/core/mocks/generated/trezorui2.pyi +++ b/core/mocks/generated/trezorui2.pyi @@ -230,7 +230,6 @@ def confirm_with_info( # rust/src/ui/model_tt/layout.rs def confirm_coinjoin( *, - coin_name: str, max_rounds: str, max_feerate: str, ) -> object: diff --git a/core/src/apps/bitcoin/authorize_coinjoin.py b/core/src/apps/bitcoin/authorize_coinjoin.py index d73d7ba905..ff502a47d3 100644 --- a/core/src/apps/bitcoin/authorize_coinjoin.py +++ b/core/src/apps/bitcoin/authorize_coinjoin.py @@ -84,7 +84,7 @@ async def authorize_coinjoin( ButtonRequestType.FeeOverThreshold, ) - await confirm_coinjoin(ctx, coin.coin_name, msg.max_rounds, max_fee_per_vbyte) + await confirm_coinjoin(ctx, msg.max_rounds, max_fee_per_vbyte) authorization.set(msg) diff --git a/core/src/trezor/ui/layouts/tt/__init__.py b/core/src/trezor/ui/layouts/tt/__init__.py index 1c075b87e1..3cb5fb24db 100644 --- a/core/src/trezor/ui/layouts/tt/__init__.py +++ b/core/src/trezor/ui/layouts/tt/__init__.py @@ -1006,12 +1006,9 @@ async def confirm_modify_fee( async def confirm_coinjoin( - ctx: wire.GenericContext, coin_name: str, max_rounds: int, max_fee_per_vbyte: str + ctx: wire.GenericContext, max_rounds: int, max_fee_per_vbyte: str ) -> None: text = Text("Authorize CoinJoin", ui.ICON_RECOVERY, new_lines=False) - text.normal("Coin name: ") - text.bold(f"{coin_name}\n") - text.br_half() text.normal("Maximum rounds: ") text.bold(f"{max_rounds}\n") text.br_half() diff --git a/core/src/trezor/ui/layouts/tt_v2/__init__.py b/core/src/trezor/ui/layouts/tt_v2/__init__.py index 476ff76c80..0d349871d8 100644 --- a/core/src/trezor/ui/layouts/tt_v2/__init__.py +++ b/core/src/trezor/ui/layouts/tt_v2/__init__.py @@ -917,14 +917,13 @@ async def confirm_modify_fee( async def confirm_coinjoin( - ctx: wire.GenericContext, coin_name: str, max_rounds: int, max_fee_per_vbyte: str + ctx: wire.GenericContext, max_rounds: int, max_fee_per_vbyte: str ) -> None: await raise_if_not_confirmed( interact( ctx, _RustLayout( trezorui2.confirm_coinjoin( - coin_name=coin_name, max_rounds=str(max_rounds), max_feerate=f"{max_fee_per_vbyte} sats/vbyte", )