Skip to content

Commit

Permalink
chore(core): update copy
Browse files Browse the repository at this point in the history
  • Loading branch information
ibz committed May 29, 2024
1 parent 4efab99 commit 2c81a4d
Show file tree
Hide file tree
Showing 15 changed files with 193 additions and 198 deletions.
1 change: 0 additions & 1 deletion core/embed/rust/librust_qstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ static void _librust_qstrs(void) {
MP_QSTR_device_name__change_template;
MP_QSTR_device_name__title;
MP_QSTR_disable_animation;
MP_QSTR_dry_run;
MP_QSTR_encode;
MP_QSTR_encoded_length;
MP_QSTR_entropy__send;
Expand Down

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

4 changes: 2 additions & 2 deletions core/embed/rust/src/ui/model_tr/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ extern "C" fn new_confirm_recovery(n_args: usize, args: *const Obj, kwargs: *mut

let title = match recovery_type {
RECOVERY_TYPE_DRY_RUN => TR::recovery__title_dry_run,
RECOVERY_TYPE_UNLOCK_REPEATED_BACKUP => TR::recovery__title_unlock_repeated_backup,
RECOVERY_TYPE_UNLOCK_REPEATED_BACKUP => TR::recovery__title_dry_run,
_ => TR::recovery__title,
};

Expand Down Expand Up @@ -1974,7 +1974,7 @@ pub static mp_module_trezorui2: Module = obj_module! {

/// def select_word_count(
/// *,
/// dry_run: bool, # unused on TR
/// recovery_type: int, # unused on TR
/// ) -> LayoutObj[int | str]:
/// """Select mnemonic word count from (12, 18, 20, 24, 33)."""
Qstr::MP_QSTR_select_word_count => obj_fn_kw!(0, new_select_word_count).as_obj(),
Expand Down
16 changes: 7 additions & 9 deletions core/embed/rust/src/ui/model_tt/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1391,9 +1391,7 @@ extern "C" fn new_confirm_recovery(n_args: usize, args: *const Obj, kwargs: *mut

let notification = match recovery_type {
RECOVERY_TYPE_DRY_RUN => TR::recovery__title_dry_run.into(),
RECOVERY_TYPE_UNLOCK_REPEATED_BACKUP => {
TR::recovery__title_unlock_repeated_backup.into()
}
RECOVERY_TYPE_UNLOCK_REPEATED_BACKUP => TR::recovery__title_dry_run.into(),
_ => TR::recovery__title.into(),
};

Expand Down Expand Up @@ -1423,11 +1421,11 @@ extern "C" fn new_confirm_recovery(n_args: usize, args: *const Obj, kwargs: *mut

extern "C" fn new_select_word_count(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj {
let block = move |_args: &[Obj], kwargs: &Map| {
let dry_run: bool = kwargs.get(Qstr::MP_QSTR_dry_run)?.try_into()?;
let title: TString = if dry_run {
TR::recovery__title_dry_run.into()
} else {
TR::recovery__title.into()
let recovery_type: u32 = kwargs.get(Qstr::MP_QSTR_recovery_type)?.try_into()?;
let title: TString = match recovery_type {
RECOVERY_TYPE_DRY_RUN => TR::recovery__title_dry_run.into(),
RECOVERY_TYPE_UNLOCK_REPEATED_BACKUP => TR::recovery__title_dry_run.into(),
_ => TR::recovery__title.into(),
};

let paragraphs = Paragraphs::new(Paragraph::new(
Expand Down Expand Up @@ -2055,7 +2053,7 @@ pub static mp_module_trezorui2: Module = obj_module! {

/// def select_word_count(
/// *,
/// dry_run: bool,
/// recovery_type: int, # RecoveryType enum, passed as an int
/// ) -> LayoutObj[int | str]: # TT returns int
/// """Select mnemonic word count from (12, 18, 20, 24, 33)."""
Qstr::MP_QSTR_select_word_count => obj_fn_kw!(0, new_select_word_count).as_obj(),
Expand Down
4 changes: 2 additions & 2 deletions core/mocks/generated/trezorui2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def confirm_recovery(
# rust/src/ui/model_tr/layout.rs
def select_word_count(
*,
dry_run: bool, # unused on TR
recovery_type: int, # unused on TR
) -> LayoutObj[int | str]:
"""Select mnemonic word count from (12, 18, 20, 24, 33)."""

Expand Down Expand Up @@ -895,7 +895,7 @@ def confirm_recovery(
# rust/src/ui/model_tt/layout.rs
def select_word_count(
*,
dry_run: bool,
recovery_type: int, # RecoveryType enum, passed as an int
) -> LayoutObj[int | str]: # TT returns int
"""Select mnemonic word count from (12, 18, 20, 24, 33)."""

Expand Down
2 changes: 1 addition & 1 deletion core/mocks/trezortranslate_keys.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ class TR:
recovery__title_remaining_shares: str = "Remaining shares"
recovery__title_unlock_repeated_backup: str = "Multi-share backup"
recovery__type_word_x_of_y_template: str = "Type word {0} of {1}"
recovery__unlock_repeated_backup: str = "Do you want to unlock the seed for repeated backup?"
recovery__unlock_repeated_backup: str = "Create additional backup?"
recovery__unlock_repeated_backup_verb: str = "Unlock backup"
recovery__wallet_recovered: str = "Wallet recovered successfully"
recovery__wanna_cancel_dry_run: str = "Are you sure you want to cancel the backup check?"
Expand Down
4 changes: 1 addition & 3 deletions core/src/apps/management/recovery_device/homescreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ async def _continue_recovery_process() -> Success:
TR.buttons__continue, TR.recovery__num_of_words
)
# ask for the number of words
word_count = await layout.request_word_count(
recovery_type == RecoveryType.DryRun
)
word_count = await layout.request_word_count(recovery_type)
# ...and only then show the starting screen with word count.
await _request_share_first_screen(word_count, recovery_type)
assert word_count is not None
Expand Down
10 changes: 5 additions & 5 deletions core/src/trezor/enums/__init__.py

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

4 changes: 2 additions & 2 deletions core/src/trezor/ui/layouts/tr/recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from . import RustLayout, raise_if_not_confirmed, show_warning


async def request_word_count(dry_run: bool) -> int:
async def request_word_count(recovery_type: RecoveryType) -> int:
count = await interact(
RustLayout(trezorui2.select_word_count(dry_run=dry_run)),
RustLayout(trezorui2.select_word_count(recovery_type=recovery_type)),
"word_count",
ButtonRequestType.MnemonicWordCount,
)
Expand Down
4 changes: 2 additions & 2 deletions core/src/trezor/ui/layouts/tt/recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ async def _is_confirmed_info(
return result is CONFIRMED


async def request_word_count(dry_run: bool) -> int:
selector = RustLayout(trezorui2.select_word_count(dry_run=dry_run))
async def request_word_count(recovery_type: RecoveryType) -> int:
selector = RustLayout(trezorui2.select_word_count(recovery_type=recovery_type))
count = await interact(selector, "word_count", ButtonRequestType.MnemonicWordCount)
return int(count)

Expand Down
2 changes: 1 addition & 1 deletion core/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@
"recovery__title_remaining_shares": "Remaining shares",
"recovery__title_unlock_repeated_backup": "Multi-share backup",
"recovery__type_word_x_of_y_template": "Type word {0} of {1}",
"recovery__unlock_repeated_backup": "Do you want to unlock the seed for repeated backup?",
"recovery__unlock_repeated_backup": "Create additional backup?",
"recovery__unlock_repeated_backup_verb": "Unlock backup",
"recovery__wallet_recovered": "Wallet recovered successfully",
"recovery__wanna_cancel_dry_run": "Are you sure you want to cancel the backup check?",
Expand Down
12 changes: 6 additions & 6 deletions python/src/trezorlib/messages.py

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

Loading

0 comments on commit 2c81a4d

Please sign in to comment.