mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-08 05:32:39 +00:00
fix(core): exclude altcoin functions from bitcoinonly build
This commit is contained in:
parent
f34ad3daf1
commit
b6e8567a49
@ -1,7 +1,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import trezorui2
|
import trezorui2
|
||||||
from trezor import TR, io, loop, ui
|
from trezor import TR, io, loop, ui, utils
|
||||||
from trezor.enums import ButtonRequestType
|
from trezor.enums import ButtonRequestType
|
||||||
from trezor.wire import ActionCancelled
|
from trezor.wire import ActionCancelled
|
||||||
from trezor.wire.context import wait as ctx_wait
|
from trezor.wire.context import wait as ctx_wait
|
||||||
@ -1079,7 +1079,9 @@ def confirm_total(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
async def confirm_ethereum_staking_tx(
|
if not utils.BITCOIN_ONLY:
|
||||||
|
|
||||||
|
async def confirm_ethereum_staking_tx(
|
||||||
title: str,
|
title: str,
|
||||||
intro_question: str,
|
intro_question: str,
|
||||||
verb: str,
|
verb: str,
|
||||||
@ -1091,7 +1093,7 @@ async def confirm_ethereum_staking_tx(
|
|||||||
chunkify: bool = False,
|
chunkify: bool = False,
|
||||||
br_type: str = "confirm_ethereum_staking_tx",
|
br_type: str = "confirm_ethereum_staking_tx",
|
||||||
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
||||||
) -> None:
|
) -> None:
|
||||||
# intro
|
# intro
|
||||||
await confirm_value(
|
await confirm_value(
|
||||||
title,
|
title,
|
||||||
@ -1128,8 +1130,7 @@ async def confirm_ethereum_staking_tx(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def confirm_solana_tx(
|
||||||
def confirm_solana_tx(
|
|
||||||
amount: str,
|
amount: str,
|
||||||
fee: str,
|
fee: str,
|
||||||
items: Iterable[tuple[str, str]],
|
items: Iterable[tuple[str, str]],
|
||||||
@ -1137,7 +1138,7 @@ def confirm_solana_tx(
|
|||||||
fee_title: str | None = None,
|
fee_title: str | None = None,
|
||||||
br_type: str = "confirm_solana_tx",
|
br_type: str = "confirm_solana_tx",
|
||||||
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
||||||
) -> Awaitable[None]:
|
) -> Awaitable[None]:
|
||||||
amount_title = (
|
amount_title = (
|
||||||
amount_title if amount_title is not None else f"{TR.words__amount}:"
|
amount_title if amount_title is not None else f"{TR.words__amount}:"
|
||||||
) # def_arg
|
) # def_arg
|
||||||
@ -1159,8 +1160,7 @@ def confirm_solana_tx(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
async def confirm_ethereum_tx(
|
||||||
async def confirm_ethereum_tx(
|
|
||||||
recipient: str,
|
recipient: str,
|
||||||
total_amount: str,
|
total_amount: str,
|
||||||
maximum_fee: str,
|
maximum_fee: str,
|
||||||
@ -1168,7 +1168,7 @@ async def confirm_ethereum_tx(
|
|||||||
br_type: str = "confirm_ethereum_tx",
|
br_type: str = "confirm_ethereum_tx",
|
||||||
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
||||||
chunkify: bool = False,
|
chunkify: bool = False,
|
||||||
) -> None:
|
) -> None:
|
||||||
summary_layout = RustLayout(
|
summary_layout = RustLayout(
|
||||||
trezorui2.altcoin_tx_summary(
|
trezorui2.altcoin_tx_summary(
|
||||||
amount_title=f"{TR.words__amount}:",
|
amount_title=f"{TR.words__amount}:",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import trezorui2
|
import trezorui2
|
||||||
from trezor import TR, ui
|
from trezor import TR, ui, utils
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Any
|
from typing import Any
|
||||||
@ -57,13 +57,13 @@ def pin_progress(message: str, description: str) -> ProgressLayout:
|
|||||||
return progress(message, description)
|
return progress(message, description)
|
||||||
|
|
||||||
|
|
||||||
def monero_keyimage_sync_progress() -> ProgressLayout:
|
if not utils.BITCOIN_ONLY:
|
||||||
|
|
||||||
|
def monero_keyimage_sync_progress() -> ProgressLayout:
|
||||||
return progress("", TR.progress__syncing)
|
return progress("", TR.progress__syncing)
|
||||||
|
|
||||||
|
def monero_live_refresh_progress() -> ProgressLayout:
|
||||||
def monero_live_refresh_progress() -> ProgressLayout:
|
|
||||||
return progress("", TR.progress__refreshing, indeterminate=True)
|
return progress("", TR.progress__refreshing, indeterminate=True)
|
||||||
|
|
||||||
|
def monero_transaction_progress_inner() -> ProgressLayout:
|
||||||
def monero_transaction_progress_inner() -> ProgressLayout:
|
|
||||||
return progress("", TR.progress__signing_transaction)
|
return progress("", TR.progress__signing_transaction)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import trezorui2
|
import trezorui2
|
||||||
from trezor import TR, io, loop, ui
|
from trezor import TR, io, loop, ui, utils
|
||||||
from trezor.enums import ButtonRequestType
|
from trezor.enums import ButtonRequestType
|
||||||
from trezor.wire import ActionCancelled
|
from trezor.wire import ActionCancelled
|
||||||
from trezor.wire.context import wait as ctx_wait
|
from trezor.wire.context import wait as ctx_wait
|
||||||
@ -1001,7 +1001,9 @@ def confirm_summary(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
async def confirm_ethereum_tx(
|
if not utils.BITCOIN_ONLY:
|
||||||
|
|
||||||
|
async def confirm_ethereum_tx(
|
||||||
recipient: str,
|
recipient: str,
|
||||||
total_amount: str,
|
total_amount: str,
|
||||||
maximum_fee: str,
|
maximum_fee: str,
|
||||||
@ -1009,7 +1011,7 @@ async def confirm_ethereum_tx(
|
|||||||
br_type: str = "confirm_ethereum_tx",
|
br_type: str = "confirm_ethereum_tx",
|
||||||
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
||||||
chunkify: bool = False,
|
chunkify: bool = False,
|
||||||
) -> None:
|
) -> None:
|
||||||
total_layout = RustLayout(
|
total_layout = RustLayout(
|
||||||
trezorui2.confirm_total(
|
trezorui2.confirm_total(
|
||||||
title=TR.words__title_summary,
|
title=TR.words__title_summary,
|
||||||
@ -1047,8 +1049,7 @@ async def confirm_ethereum_tx(
|
|||||||
except ActionCancelled:
|
except ActionCancelled:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
async def confirm_ethereum_staking_tx(
|
||||||
async def confirm_ethereum_staking_tx(
|
|
||||||
title: str,
|
title: str,
|
||||||
intro_question: str,
|
intro_question: str,
|
||||||
verb: str,
|
verb: str,
|
||||||
@ -1060,7 +1061,7 @@ async def confirm_ethereum_staking_tx(
|
|||||||
chunkify: bool = False,
|
chunkify: bool = False,
|
||||||
br_type: str = "confirm_ethereum_staking_tx",
|
br_type: str = "confirm_ethereum_staking_tx",
|
||||||
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
||||||
) -> None:
|
) -> None:
|
||||||
# intro
|
# intro
|
||||||
await confirm_value(
|
await confirm_value(
|
||||||
title,
|
title,
|
||||||
@ -1092,8 +1093,7 @@ async def confirm_ethereum_staking_tx(
|
|||||||
br_code=br_code,
|
br_code=br_code,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def confirm_solana_tx(
|
||||||
def confirm_solana_tx(
|
|
||||||
amount: str,
|
amount: str,
|
||||||
fee: str,
|
fee: str,
|
||||||
items: Iterable[tuple[str, str]],
|
items: Iterable[tuple[str, str]],
|
||||||
@ -1101,7 +1101,7 @@ def confirm_solana_tx(
|
|||||||
fee_title: str | None = None,
|
fee_title: str | None = None,
|
||||||
br_type: str = "confirm_solana_tx",
|
br_type: str = "confirm_solana_tx",
|
||||||
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
br_code: ButtonRequestType = ButtonRequestType.SignTx,
|
||||||
) -> Awaitable[None]:
|
) -> Awaitable[None]:
|
||||||
amount_title = (
|
amount_title = (
|
||||||
amount_title if amount_title is not None else f"{TR.words__amount}:"
|
amount_title if amount_title is not None else f"{TR.words__amount}:"
|
||||||
) # def_arg
|
) # def_arg
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import trezorui2
|
import trezorui2
|
||||||
from trezor import TR, ui
|
from trezor import TR, ui, utils
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Any
|
from typing import Any
|
||||||
@ -60,13 +60,13 @@ def pin_progress(message: str, description: str) -> ProgressLayout:
|
|||||||
return progress(message, description=description)
|
return progress(message, description=description)
|
||||||
|
|
||||||
|
|
||||||
def monero_keyimage_sync_progress() -> ProgressLayout:
|
if not utils.BITCOIN_ONLY:
|
||||||
|
|
||||||
|
def monero_keyimage_sync_progress() -> ProgressLayout:
|
||||||
return progress("", TR.progress__syncing)
|
return progress("", TR.progress__syncing)
|
||||||
|
|
||||||
|
def monero_live_refresh_progress() -> ProgressLayout:
|
||||||
def monero_live_refresh_progress() -> ProgressLayout:
|
|
||||||
return progress("", TR.progress__refreshing, indeterminate=True)
|
return progress("", TR.progress__refreshing, indeterminate=True)
|
||||||
|
|
||||||
|
def monero_transaction_progress_inner() -> ProgressLayout:
|
||||||
def monero_transaction_progress_inner() -> ProgressLayout:
|
|
||||||
return progress("", TR.progress__signing_transaction)
|
return progress("", TR.progress__signing_transaction)
|
||||||
|
Loading…
Reference in New Issue
Block a user