Skip to content

Commit

Permalink
fix(core/ui): fix title of XPUB success screen
Browse files Browse the repository at this point in the history
  • Loading branch information
obrusvit committed Oct 2, 2024
1 parent 9416caa commit ceecaa3
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 5 deletions.
1 change: 1 addition & 0 deletions core/.changelog.d/3947.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[T3T1] Fix XPUB confirmed success screen title
2 changes: 2 additions & 0 deletions core/embed/rust/librust_qstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ static void _librust_qstrs(void) {
MP_QSTR_address__cancel_receive;
MP_QSTR_address__confirmed;
MP_QSTR_address__public_key;
MP_QSTR_address__public_key_confirmed;
MP_QSTR_address__qr_code;
MP_QSTR_address__title_cosigner;
MP_QSTR_address__title_receive_address;
Expand Down Expand Up @@ -679,6 +680,7 @@ static void _librust_qstrs(void) {
MP_QSTR_time_ms;
MP_QSTR_timer;
MP_QSTR_title;
MP_QSTR_title_success;
MP_QSTR_total_amount;
MP_QSTR_total_fee_new;
MP_QSTR_total_label;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion core/embed/rust/src/ui/model_mercury/flow/get_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ impl GetAddress {
let path: Option<TString> = kwargs.get(Qstr::MP_QSTR_path)?.try_into_option()?;
let xpubs: Obj = kwargs.get(Qstr::MP_QSTR_xpubs)?;

let title_success: TString = kwargs.get(Qstr::MP_QSTR_title_success)?.try_into()?;

let br_name: TString = kwargs.get(Qstr::MP_QSTR_br_name)?.try_into()?;
let br_code: u16 = kwargs.get(Qstr::MP_QSTR_br_code)?.try_into()?;

Expand Down Expand Up @@ -150,7 +152,7 @@ impl GetAddress {

let content_confirmed = Frame::left_aligned(
TR::words__title_success.into(),
StatusScreen::new_success_timeout(TR::address__confirmed.into()),
StatusScreen::new_success_timeout(title_success),
)
.with_footer(TR::instructions__continue_in_app.into(), None)
.with_result_icon(theme::ICON_BULLET_CHECKMARK, theme::GREEN_LIGHT)
Expand Down
1 change: 1 addition & 0 deletions core/embed/rust/src/ui/model_mercury/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1659,6 +1659,7 @@ pub static mp_module_trezorui2: Module = obj_module! {
/// account: str | None,
/// path: str | None,
/// xpubs: list[tuple[str, str]],
/// title_success: str,
/// br_code: ButtonRequestType,
/// br_name: str,
/// ) -> LayoutObj[UiResult]:
Expand Down
1 change: 1 addition & 0 deletions core/mocks/generated/trezorui2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ def flow_get_address(
account: str | None,
path: str | None,
xpubs: list[tuple[str, str]],
title_success: str,
br_code: ButtonRequestType,
br_name: str,
) -> LayoutObj[UiResult]:
Expand Down
1 change: 1 addition & 0 deletions core/mocks/trezortranslate_keys.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class TR:
address__cancel_receive: str = "Cancel receive"
address__confirmed: str = "Receive address confirmed"
address__public_key: str = "Public key"
address__public_key_confirmed: str = "Public key confirmed"
address__qr_code: str = "QR code"
address__title_cosigner: str = "Cosigner"
address__title_receive_address: str = "Receive address"
Expand Down
7 changes: 7 additions & 0 deletions core/src/trezor/ui/layouts/mercury/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,12 @@ def xpub_title(i: int) -> str:
)
return result

title_success = (
TR.address__public_key_confirmed
if title in ("XPUB", TR.address__public_key)
else TR.address__confirmed
)

await raise_if_not_confirmed(
RustLayout(
trezorui2.flow_get_address(
Expand All @@ -527,6 +533,7 @@ def xpub_title(i: int) -> str:
account=account,
path=path,
xpubs=[(xpub_title(i), xpub) for i, xpub in enumerate(xpubs)],
title_success=title_success,
br_name=br_name,
br_code=br_code,
)
Expand Down
1 change: 1 addition & 0 deletions core/translations/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"address__cancel_receive": "Zrušit příjem",
"address__confirmed": "Adresa příjemce potvrzena",
"address__public_key": "Veřejný klíč",
"address__public_key_confirmed": "Veřejný klíč potvrzen",
"address__qr_code": "QR kód",
"address__title_cosigner": "Další podepisující",
"address__title_receive_address": "Přijímací adresa",
Expand Down
1 change: 1 addition & 0 deletions core/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"address__cancel_receive": "Empfang abbr.",
"address__confirmed": "Empfängeradresse bestätigt",
"address__public_key": "Public Key",
"address__public_key_confirmed": "Public Key bestätigt",
"address__qr_code": "QR-Code",
"address__title_cosigner": "Mitunterzeich.",
"address__title_receive_address": "Empfäng-adresse",
Expand Down
1 change: 1 addition & 0 deletions core/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"address__cancel_receive": "Cancel receive",
"address__confirmed": "Receive address confirmed",
"address__public_key": "Public key",
"address__public_key_confirmed": "Public key confirmed",
"address__qr_code": "QR code",
"address__title_cosigner": "Cosigner",
"address__title_receive_address": "Receive address",
Expand Down
1 change: 1 addition & 0 deletions core/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"address__cancel_receive": "Cancelar destino",
"address__confirmed": "Dirección de destino confirmada",
"address__public_key": "Clave pública",
"address__public_key_confirmed": "Clave pública confirmada",
"address__qr_code": "Código QR",
"address__title_cosigner": "Cofirmante",
"address__title_receive_address": "Dirección destino",
Expand Down
1 change: 1 addition & 0 deletions core/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"address__cancel_receive": "Annuler réception",
"address__confirmed": "Adresse de réception confirmée",
"address__public_key": "Clé publique",
"address__public_key_confirmed": "Clé publique confirmée",
"address__qr_code": "Code QR",
"address__title_cosigner": "Cosignataire",
"address__title_receive_address": "Adr. de récep.",
Expand Down
1 change: 1 addition & 0 deletions core/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"addr_mismatch__wrong_derivation_path": "Percorso deriv. errato per conto selezion.",
"addr_mismatch__xpub_mismatch": "XPUB non corrisp.?",
"address__public_key": "Chiave pubblica",
"address__public_key_confirmed": "Chiave pubblica confermata",
"address__title_cosigner": "Cofirmatario",
"address__title_receive_address": "Indirizzo ricez.",
"address__title_yours": "I tuoi",
Expand Down
3 changes: 2 additions & 1 deletion core/translations/order.json
Original file line number Diff line number Diff line change
Expand Up @@ -964,5 +964,6 @@
"962": "fido__title_for_authentication",
"963": "fido__title_select_credential",
"964": "instructions__swipe_down",
"965": "fido__title_credential_details"
"965": "fido__title_credential_details",
"966": "address__public_key_confirmed"
}
1 change: 1 addition & 0 deletions core/translations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"addr_mismatch__xpub_mismatch": "XPUB não coincide?",
"address__cancel_receive": "Canc. receb.",
"address__public_key": "Chave pública",
"address__public_key_confirmed": "Chave pública confirmada",
"address__title_cosigner": "Cosigner",
"address__title_receive_address": "End. de recebimento",
"address__title_yours": "Seu",
Expand Down
6 changes: 3 additions & 3 deletions core/translations/signatures.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"current": {
"merkle_root": "b2e87e7efbbe9071b398822f29d4f77a8428b216c6ec6f34e4e84f8d311c0401",
"datetime": "2024-10-01T16:40:42.014914",
"commit": "830dd3e7bc4ceca71fecb14abdd04eda2ea28f44"
"merkle_root": "b6f219293d33f026ebcee6b877ec62903a082f2cedb71053de8ecf614c4b7e4f",
"datetime": "2024-10-02T09:30:46.734439",
"commit": "774f9de745ec38d79c06cbe487af46b8e0136950"
},
"history": [
{
Expand Down
1 change: 1 addition & 0 deletions core/translations/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"addr_mismatch__wrong_derivation_path": "Seçilen hesap için türetme yolu yanlış.",
"addr_mismatch__xpub_mismatch": "XPUB uyumsuz mu?",
"address__public_key": "Genel anahtar",
"address__public_key_confirmed": "Genel anahtar onaylandı",
"address__title_cosigner": "Müşterek i̇mzalayan",
"address__title_receive_address": "Alma adresi̇",
"address__title_yours": "Si̇zi̇nki̇",
Expand Down

0 comments on commit ceecaa3

Please sign in to comment.