diff --git a/core/src/apps/bitcoin/authorize_coinjoin.py b/core/src/apps/bitcoin/authorize_coinjoin.py index 48bd27b45..953120729 100644 --- a/core/src/apps/bitcoin/authorize_coinjoin.py +++ b/core/src/apps/bitcoin/authorize_coinjoin.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING from trezor import ui, wire from trezor.enums import ButtonRequestType from trezor.messages import AuthorizeCoinJoin, Success -from trezor.strings import format_amount from trezor.ui.layouts import confirm_action, confirm_coinjoin, confirm_metadata from apps.common import authorization, safety_checks @@ -12,7 +11,7 @@ from apps.common.keychain import FORBIDDEN_KEY_PATH from apps.common.paths import SLIP25_PURPOSE, validate_path from .authorization import FEE_RATE_DECIMALS -from .common import BIP32_WALLET_DEPTH +from .common import BIP32_WALLET_DEPTH, format_fee_rate from .keychain import validate_path_against_script_type, with_keychain if TYPE_CHECKING: @@ -72,14 +71,16 @@ async def authorize_coinjoin( ), ) - max_fee_per_vbyte = format_amount(msg.max_fee_per_kvbyte, 3) + max_fee_per_vbyte = format_fee_rate( + msg.max_fee_per_kvbyte / 1000, coin, include_shortcut=True + ) if msg.max_fee_per_kvbyte > coin.maxfee_kb: await confirm_metadata( ctx, "fee_over_threshold", "High mining fee", - "The mining fee of\n{} sats/vbyte\nis unexpectedly high.", + "The mining fee of\n{}\nis unexpectedly high.", max_fee_per_vbyte, ButtonRequestType.FeeOverThreshold, ) diff --git a/core/src/trezor/ui/layouts/tt/__init__.py b/core/src/trezor/ui/layouts/tt/__init__.py index 2d2c580fa..5988d39b2 100644 --- a/core/src/trezor/ui/layouts/tt/__init__.py +++ b/core/src/trezor/ui/layouts/tt/__init__.py @@ -1013,7 +1013,7 @@ async def confirm_coinjoin( text.bold(f"{max_rounds}\n") text.br_half() text.normal("Maximum mining fee:\n") - text.bold(f"{max_fee_per_vbyte} sats/vbyte") + text.bold(max_fee_per_vbyte) await raise_if_cancelled( interact(ctx, HoldToConfirm(text), "coinjoin_final", ButtonRequestType.Other) ) diff --git a/core/src/trezor/ui/layouts/tt_v2/__init__.py b/core/src/trezor/ui/layouts/tt_v2/__init__.py index 0d349871d..cf9879310 100644 --- a/core/src/trezor/ui/layouts/tt_v2/__init__.py +++ b/core/src/trezor/ui/layouts/tt_v2/__init__.py @@ -925,7 +925,7 @@ async def confirm_coinjoin( _RustLayout( trezorui2.confirm_coinjoin( max_rounds=str(max_rounds), - max_feerate=f"{max_fee_per_vbyte} sats/vbyte", + max_feerate=max_fee_per_vbyte, ) ), "coinjoin_final",