From 7c375bdc07e59307741c07e916d3888470d2c92b Mon Sep 17 00:00:00 2001 From: obrusvit Date: Wed, 11 Dec 2024 13:55:54 +0100 Subject: [PATCH] feat(contacts): new contact confirmation --- .../embed/rust/src/ui/model_mercury/layout.rs | 1 + core/src/apps/bitcoin/sign_message.py | 30 +++++++++++----- .../src/trezor/ui/layouts/mercury/__init__.py | 36 +++++++++++++++++++ 3 files changed, 58 insertions(+), 9 deletions(-) diff --git a/core/embed/rust/src/ui/model_mercury/layout.rs b/core/embed/rust/src/ui/model_mercury/layout.rs index aa4c68d85d..4838aeb503 100644 --- a/core/embed/rust/src/ui/model_mercury/layout.rs +++ b/core/embed/rust/src/ui/model_mercury/layout.rs @@ -810,6 +810,7 @@ extern "C" fn new_confirm_value(n_args: usize, args: *const Obj, kwargs: *mut Ma .with_text_mono(text_mono) .with_prompt(hold) .with_hold(hold) + .with_description_font(&theme::TEXT_SUB_GREY) .into_flow() .and_then(LayoutObj::new_root) .map(Into::into) diff --git a/core/src/apps/bitcoin/sign_message.py b/core/src/apps/bitcoin/sign_message.py index 2cd735a522..4083ab53ea 100644 --- a/core/src/apps/bitcoin/sign_message.py +++ b/core/src/apps/bitcoin/sign_message.py @@ -17,7 +17,7 @@ async def sign_message( from trezor.crypto.curve import secp256k1 from trezor.enums import InputScriptType from trezor.messages import MessageSignature - from trezor.ui.layouts import confirm_signverify + from trezor.ui.layouts import confirm_signverify, confirm_new_contact from apps.common.paths import address_n_to_str, validate_path from apps.common.signverify import decode_message, message_digest @@ -40,14 +40,26 @@ async def sign_message( address = get_address(script_type, coin, node) path = address_n_to_str(address_n) account = address_n_to_name_or_unknown(coin, address_n, script_type) - await confirm_signverify( - decode_message(message), - address_short(coin, address), - verify=False, - account=account, - path=path, - chunkify=bool(msg.chunkify), - ) + message_decoded = decode_message(message) + if "/" in message_decoded: + # message will have format