mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-31 19:08:28 +00:00
chore(core/eckhart): update warnings
This commit is contained in:
parent
f32d747f88
commit
a7f6bf5bda
@ -683,6 +683,7 @@ static void _librust_qstrs(void) {
|
||||
MP_QSTR_send__incl_transaction_fee;
|
||||
MP_QSTR_send__including_fee;
|
||||
MP_QSTR_send__maximum_fee;
|
||||
MP_QSTR_send__multisig_different_paths;
|
||||
MP_QSTR_send__receiving_to_multisig;
|
||||
MP_QSTR_send__send_from;
|
||||
MP_QSTR_send__send_in_the_app;
|
||||
|
@ -1447,6 +1447,7 @@ pub enum TranslatedString {
|
||||
reset__select_word_from_share_template = 1043, // "Select word #{0} from\nShare #{1}"
|
||||
recovery__share_from_group_entered_template = 1044, // "Share #{0} from Group #{1} entered."
|
||||
send__cancel_transaction = 1045, // "Cancel transaction"
|
||||
send__multisig_different_paths = 1046, // "Using different paths for different XPUBs."
|
||||
}
|
||||
|
||||
impl TranslatedString {
|
||||
@ -3199,6 +3200,7 @@ impl TranslatedString {
|
||||
(Self::reset__select_word_from_share_template, "Select word #{0} from\nShare #{1}"),
|
||||
(Self::recovery__share_from_group_entered_template, "Share #{0} from Group #{1} entered."),
|
||||
(Self::send__cancel_transaction, "Cancel transaction"),
|
||||
(Self::send__multisig_different_paths, "Using different paths for different XPUBs."),
|
||||
];
|
||||
|
||||
#[cfg(feature = "micropython")]
|
||||
@ -4269,6 +4271,7 @@ impl TranslatedString {
|
||||
(Qstr::MP_QSTR_send__incl_transaction_fee, Self::send__incl_transaction_fee),
|
||||
(Qstr::MP_QSTR_send__including_fee, Self::send__including_fee),
|
||||
(Qstr::MP_QSTR_send__maximum_fee, Self::send__maximum_fee),
|
||||
(Qstr::MP_QSTR_send__multisig_different_paths, Self::send__multisig_different_paths),
|
||||
(Qstr::MP_QSTR_send__receiving_to_multisig, Self::send__receiving_to_multisig),
|
||||
(Qstr::MP_QSTR_send__send_from, Self::send__send_from),
|
||||
(Qstr::MP_QSTR_send__send_in_the_app, Self::send__send_in_the_app),
|
||||
|
@ -767,6 +767,7 @@ class TR:
|
||||
send__incl_transaction_fee: str = "incl. Transaction fee"
|
||||
send__including_fee: str = "Including fee:"
|
||||
send__maximum_fee: str = "Maximum fee"
|
||||
send__multisig_different_paths: str = "Using different paths for different XPUBs."
|
||||
send__receiving_to_multisig: str = "Receiving to a multisig address."
|
||||
send__send_from: str = "Send from"
|
||||
send__send_in_the_app: str = "After signing, send the transaction in the app."
|
||||
|
@ -290,13 +290,7 @@ async def confirm_nondefault_locktime(lock_time: int, lock_time_disabled: bool)
|
||||
from trezor.strings import format_timestamp
|
||||
|
||||
if lock_time_disabled:
|
||||
await layouts.show_warning(
|
||||
"nondefault_locktime",
|
||||
TR.bitcoin__locktime_no_effect,
|
||||
TR.words__continue_anyway_question,
|
||||
button=TR.buttons__continue,
|
||||
br_code=ButtonRequestType.SignTx,
|
||||
)
|
||||
await layouts.lock_time_disabled_warning()
|
||||
else:
|
||||
if lock_time < _LOCKTIME_TIMESTAMP_MIN_VALUE:
|
||||
text = TR.bitcoin__locktime_set_to_blockheight
|
||||
|
@ -175,7 +175,7 @@ def confirm_multisig_warning() -> Awaitable[None]:
|
||||
def confirm_multisig_different_paths_warning() -> Awaitable[None]:
|
||||
return show_warning(
|
||||
"warning_multisig_different_paths",
|
||||
"Using different paths for different XPUBs.",
|
||||
TR.send__multisig_different_paths,
|
||||
TR.words__continue_anyway_question,
|
||||
)
|
||||
|
||||
@ -190,6 +190,16 @@ def confirm_multiple_accounts_warning() -> Awaitable[None]:
|
||||
)
|
||||
|
||||
|
||||
def lock_time_disabled_warning() -> Awaitable[None]:
|
||||
return show_warning(
|
||||
"nondefault_locktime",
|
||||
TR.bitcoin__locktime_no_effect,
|
||||
TR.words__continue_anyway_question,
|
||||
button=TR.buttons__continue,
|
||||
br_code=ButtonRequestType.SignTx,
|
||||
)
|
||||
|
||||
|
||||
def confirm_homescreen(image: bytes) -> Awaitable[None]:
|
||||
return raise_if_not_confirmed(
|
||||
trezorui_api.confirm_homescreen(
|
||||
|
@ -192,7 +192,7 @@ def confirm_multisig_warning() -> Awaitable[ui.UiResult]:
|
||||
def confirm_multisig_different_paths_warning() -> Awaitable[ui.UiResult]:
|
||||
return show_warning(
|
||||
"warning_multisig_different_paths",
|
||||
"Using different paths for different XPUBs.",
|
||||
TR.send__multisig_different_paths,
|
||||
TR.words__continue_anyway_question,
|
||||
)
|
||||
|
||||
@ -207,6 +207,16 @@ def confirm_multiple_accounts_warning() -> Awaitable[ui.UiResult]:
|
||||
)
|
||||
|
||||
|
||||
def lock_time_disabled_warning() -> Awaitable[ui.UiResult]:
|
||||
return show_warning(
|
||||
"nondefault_locktime",
|
||||
TR.bitcoin__locktime_no_effect,
|
||||
TR.words__continue_anyway_question,
|
||||
button=TR.buttons__continue,
|
||||
br_code=ButtonRequestType.SignTx,
|
||||
)
|
||||
|
||||
|
||||
def confirm_homescreen(image: bytes) -> Awaitable[None]:
|
||||
return raise_if_not_confirmed(
|
||||
trezorui_api.confirm_homescreen(
|
||||
|
@ -158,7 +158,7 @@ def confirm_multisig_different_paths_warning() -> Awaitable[None]:
|
||||
return raise_if_not_confirmed(
|
||||
trezorui_api.show_danger(
|
||||
title=f"{TR.words__important}!",
|
||||
description="Using different paths for different XPUBs.",
|
||||
description=TR.send__multisig_different_paths,
|
||||
),
|
||||
"warning_multisig_different_paths",
|
||||
br_code=ButtonRequestType.Warning,
|
||||
@ -174,6 +174,16 @@ def confirm_multiple_accounts_warning() -> Awaitable[None]:
|
||||
)
|
||||
|
||||
|
||||
def lock_time_disabled_warning() -> Awaitable[None]:
|
||||
return show_warning(
|
||||
"nondefault_locktime",
|
||||
TR.bitcoin__locktime_no_effect,
|
||||
TR.words__continue_anyway_question,
|
||||
button=TR.buttons__continue,
|
||||
br_code=ButtonRequestType.SignTx,
|
||||
)
|
||||
|
||||
|
||||
def confirm_homescreen(
|
||||
image: bytes,
|
||||
) -> Awaitable[None]:
|
||||
|
@ -163,14 +163,13 @@ def confirm_multisig_warning() -> Awaitable[None]:
|
||||
|
||||
|
||||
def confirm_multisig_different_paths_warning() -> Awaitable[None]:
|
||||
return raise_if_not_confirmed(
|
||||
trezorui_api.show_danger(
|
||||
title=TR.words__pay_attention,
|
||||
description="Using different paths for different XPUBs.",
|
||||
menu_title=TR.words__receive,
|
||||
),
|
||||
return show_danger(
|
||||
"warning_multisig_different_paths",
|
||||
content=TR.send__multisig_different_paths,
|
||||
title=TR.words__important,
|
||||
menu_title=TR.words__receive,
|
||||
br_code=ButtonRequestType.Warning,
|
||||
verb_cancel=TR.words__cancel_and_exit,
|
||||
)
|
||||
|
||||
|
||||
@ -184,6 +183,14 @@ def confirm_multiple_accounts_warning() -> Awaitable[None]:
|
||||
)
|
||||
|
||||
|
||||
def lock_time_disabled_warning() -> Awaitable[None]:
|
||||
return show_warning(
|
||||
"nondefault_locktime",
|
||||
TR.bitcoin__locktime_no_effect,
|
||||
br_code=ButtonRequestType.SignTx,
|
||||
)
|
||||
|
||||
|
||||
def confirm_homescreen(
|
||||
image: bytes,
|
||||
) -> Awaitable[None]:
|
||||
@ -366,12 +373,13 @@ def show_warning(
|
||||
button: str | None = None,
|
||||
br_code: ButtonRequestType = ButtonRequestType.Warning,
|
||||
) -> Awaitable[None]:
|
||||
button = button or TR.buttons__continue # def_arg
|
||||
button = button or TR.words__continue_anyway # def_arg
|
||||
return raise_if_not_confirmed(
|
||||
trezorui_api.show_warning(
|
||||
title=TR.words__important,
|
||||
value=content,
|
||||
button=subheader or TR.words__continue_anyway_question,
|
||||
button=button,
|
||||
description=content,
|
||||
value=subheader or "",
|
||||
danger=True,
|
||||
),
|
||||
br_name,
|
||||
|
@ -975,6 +975,7 @@
|
||||
"send__including_fee": "Including fee:",
|
||||
"send__maximum_fee": "Maximum fee",
|
||||
"send__receiving_to_multisig": "Receiving to a multisig address.",
|
||||
"send__multisig_different_paths": "Using different paths for different XPUBs.",
|
||||
"send__send_from": "Send from",
|
||||
"send__cancel_transaction": "Cancel transaction",
|
||||
"send__sign_transaction": "Sign transaction",
|
||||
|
@ -1044,5 +1044,6 @@
|
||||
"1042": "reset__check_share_backup_template",
|
||||
"1043": "reset__select_word_from_share_template",
|
||||
"1044": "recovery__share_from_group_entered_template",
|
||||
"1045": "send__cancel_transaction"
|
||||
"1045": "send__cancel_transaction",
|
||||
"1046": "send__multisig_different_paths"
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"current": {
|
||||
"merkle_root": "4a06e39dde3af691ccef119898d3124fb596e384b777a55044f29d27a7ebbd8e",
|
||||
"datetime": "2025-06-23T10:46:39.805001+00:00",
|
||||
"commit": "f8327ed2c85209eafbe0c73eeea8861bf1cb57d7"
|
||||
"merkle_root": "9bf21982ee758961ef15e5436ea363d19b02d5d6760f4916e4090ac44c3140f4",
|
||||
"datetime": "2025-06-23T10:48:03.422303+00:00",
|
||||
"commit": "5bc936133a6ed97c2cd7c448facffc86847ae25c"
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
|
@ -179,8 +179,9 @@ def test_attack_path_segwit(client: Client):
|
||||
return msg
|
||||
|
||||
with client:
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
if is_core(client):
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
client.set_filter(messages.TxAck, attack_processor)
|
||||
with pytest.raises(TrezorFailure):
|
||||
btc.sign_tx(
|
||||
|
@ -18,6 +18,7 @@ from trezorlib import btc, messages
|
||||
from trezorlib.debuglink import TrezorClientDebugLink as Client
|
||||
from trezorlib.tools import parse_path
|
||||
|
||||
from ...common import is_core
|
||||
from ...input_flows import InputFlowConfirmAllWarnings
|
||||
from ...tx_cache import TxCache
|
||||
from .signtx import assert_tx_matches
|
||||
@ -60,8 +61,9 @@ def test_non_segwit_segwit_inputs(client: Client):
|
||||
)
|
||||
|
||||
with client:
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
if is_core(client):
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
signatures, serialized_tx = btc.sign_tx(
|
||||
client, "Testnet", [inp1, inp2], [out1], prev_txes=TX_API
|
||||
)
|
||||
@ -98,8 +100,9 @@ def test_segwit_non_segwit_inputs(client: Client):
|
||||
)
|
||||
|
||||
with client:
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
if is_core(client):
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
signatures, serialized_tx = btc.sign_tx(
|
||||
client, "Testnet", [inp1, inp2], [out1], prev_txes=TX_API
|
||||
)
|
||||
@ -144,8 +147,9 @@ def test_segwit_non_segwit_segwit_inputs(client: Client):
|
||||
)
|
||||
|
||||
with client:
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
if is_core(client):
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
signatures, serialized_tx = btc.sign_tx(
|
||||
client, "Testnet", [inp1, inp2, inp3], [out1], prev_txes=TX_API
|
||||
)
|
||||
@ -188,8 +192,9 @@ def test_non_segwit_segwit_non_segwit_inputs(client: Client):
|
||||
)
|
||||
|
||||
with client:
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
if is_core(client):
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
signatures, serialized_tx = btc.sign_tx(
|
||||
client, "Testnet", [inp1, inp2, inp3], [out1], prev_txes=TX_API
|
||||
)
|
||||
|
@ -423,8 +423,9 @@ def test_attack_mixed_inputs(client: Client):
|
||||
expected_responses.insert(-2, request_input(0))
|
||||
|
||||
with client:
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
if is_core(client):
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
# Sign unmodified transaction.
|
||||
# "Fee over threshold" warning is displayed - fee is the whole TRUE_AMOUNT
|
||||
client.set_expected_responses(expected_responses)
|
||||
@ -450,8 +451,9 @@ def test_attack_mixed_inputs(client: Client):
|
||||
)
|
||||
|
||||
with pytest.raises(TrezorFailure) as e, client:
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
if is_core(client):
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
client.set_expected_responses(expected_responses)
|
||||
btc.sign_tx(
|
||||
client,
|
||||
|
@ -345,8 +345,9 @@ def test_send_both(client: Client):
|
||||
)
|
||||
|
||||
with client:
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
if is_core(client):
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
client.set_expected_responses(
|
||||
[
|
||||
request_input(0),
|
||||
|
@ -224,8 +224,9 @@ def test_send_mixed(client: Client):
|
||||
)
|
||||
|
||||
with client:
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
if is_core(client):
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
client.set_expected_responses(
|
||||
[
|
||||
# process inputs
|
||||
@ -358,8 +359,9 @@ def test_attack_script_type(client: Client):
|
||||
return msg
|
||||
|
||||
with client:
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
if is_core(client):
|
||||
IF = InputFlowConfirmAllWarnings(client)
|
||||
client.set_input_flow(IF.get())
|
||||
client.set_filter(messages.TxAck, attack_processor)
|
||||
client.set_expected_responses(
|
||||
[
|
||||
|
@ -1171,20 +1171,20 @@ def sign_tx_go_to_info_eckhart(
|
||||
yield
|
||||
client.debug.read_layout()
|
||||
client.debug.click(client.debug.screen_buttons.menu())
|
||||
client.debug.synchronize_at("VerticalMenuScreen")
|
||||
client.debug.synchronize_at("VerticalMenu")
|
||||
client.debug.click(client.debug.screen_buttons.vertical_menu_items()[1])
|
||||
|
||||
yield # confirm transaction
|
||||
client.debug.read_layout()
|
||||
client.debug.click(client.debug.screen_buttons.menu())
|
||||
client.debug.synchronize_at("VerticalMenuScreen")
|
||||
client.debug.synchronize_at("VerticalMenu")
|
||||
client.debug.click(client.debug.screen_buttons.vertical_menu_items()[0])
|
||||
|
||||
layout = client.debug.read_layout()
|
||||
content = layout.text_content()
|
||||
|
||||
client.debug.click(client.debug.screen_buttons.menu())
|
||||
client.debug.synchronize_at("VerticalMenuScreen")
|
||||
client.debug.synchronize_at("VerticalMenu")
|
||||
client.debug.click(client.debug.screen_buttons.vertical_menu_items()[1])
|
||||
|
||||
layout = client.debug.read_layout()
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user