1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

feat(core): Remove coin name from CoinJoin confirmation dialog.

[no changelog]
This commit is contained in:
Andrew Kozlik 2022-10-24 20:02:37 +02:00 committed by Andrew Kozlik
parent b7f86ec158
commit 627ef9748f
5 changed files with 3 additions and 12 deletions

View File

@ -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 { extern "C" fn new_confirm_coinjoin(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 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_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 max_feerate: StrBuffer = kwargs.get(Qstr::MP_QSTR_max_feerate)?.try_into()?;
let paragraphs = Paragraphs::new([ 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_NORMAL, "Maximum rounds:".into()),
Paragraph::new(&theme::TEXT_BOLD, max_rounds), Paragraph::new(&theme::TEXT_BOLD, max_rounds),
Paragraph::new(&theme::TEXT_NORMAL, "Maximum mining fee:".into()), Paragraph::new(&theme::TEXT_NORMAL, "Maximum mining fee:".into()),
@ -1263,7 +1260,6 @@ pub static mp_module_trezorui2: Module = obj_module! {
/// def confirm_coinjoin( /// def confirm_coinjoin(
/// *, /// *,
/// coin_name: str,
/// max_rounds: str, /// max_rounds: str,
/// max_feerate: str, /// max_feerate: str,
/// ) -> object: /// ) -> object:

View File

@ -230,7 +230,6 @@ def confirm_with_info(
# rust/src/ui/model_tt/layout.rs # rust/src/ui/model_tt/layout.rs
def confirm_coinjoin( def confirm_coinjoin(
*, *,
coin_name: str,
max_rounds: str, max_rounds: str,
max_feerate: str, max_feerate: str,
) -> object: ) -> object:

View File

@ -84,7 +84,7 @@ async def authorize_coinjoin(
ButtonRequestType.FeeOverThreshold, 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) authorization.set(msg)

View File

@ -1006,12 +1006,9 @@ async def confirm_modify_fee(
async def confirm_coinjoin( 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: ) -> None:
text = Text("Authorize CoinJoin", ui.ICON_RECOVERY, new_lines=False) 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.normal("Maximum rounds: ")
text.bold(f"{max_rounds}\n") text.bold(f"{max_rounds}\n")
text.br_half() text.br_half()

View File

@ -917,14 +917,13 @@ async def confirm_modify_fee(
async def confirm_coinjoin( 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: ) -> None:
await raise_if_not_confirmed( await raise_if_not_confirmed(
interact( interact(
ctx, ctx,
_RustLayout( _RustLayout(
trezorui2.confirm_coinjoin( trezorui2.confirm_coinjoin(
coin_name=coin_name,
max_rounds=str(max_rounds), max_rounds=str(max_rounds),
max_feerate=f"{max_fee_per_vbyte} sats/vbyte", max_feerate=f"{max_fee_per_vbyte} sats/vbyte",
) )