Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/embed/bootloader/version.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#define VERSION_MAJOR 2
#define VERSION_MINOR 6
#define VERSION_MINOR 7
#define VERSION_PATCH 0
#define VERSION_BUILD 0
#define VERSION_UINT32 \
(VERSION_MAJOR | (VERSION_MINOR << 8) | (VERSION_PATCH << 16) | \
(VERSION_BUILD << 24))

#define FIX_VERSION_MAJOR 2
#define FIX_VERSION_MINOR 6
#define FIX_VERSION_MINOR 7
#define FIX_VERSION_PATCH 0
#define FIX_VERSION_BUILD 0

Expand Down
70 changes: 1 addition & 69 deletions core/src/apps/benfen/sign_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

from . import ICON, PRIMARY_COLOR
from .helper import INTENT_BYTES, benfen_address_from_pubkey, try_convert_to_bfc_address
from .layout import require_confirm_fee, require_show_overview
from .tx_parser import TransactionParser


async def process_transaction(
Expand All @@ -23,76 +21,10 @@ async def process_transaction(
tx_bytes: bytes,
coin_type: bytes,
) -> bytes:
parser = TransactionParser()

intent = tx_bytes[:3]
if INTENT_BYTES != intent:
raise wire.DataError("Invalid raw tx")

if coin_type:
try:
if not all(c < 128 for c in coin_type):
await confirm_blind_sign_common(ctx, address, tx_bytes)
return blake2b(data=tx_bytes, outlen=32).digest()
currency_symbol = coin_type.decode("ascii")
if currency_symbol and "::" in currency_symbol:
currency_symbol = currency_symbol.split("::")[-1]
ALLOWED_TOKENS = {
"BJPY",
"BUSD",
"LONG",
"BF_USDC",
"BF_USDT",
"BFC",
"BAUD",
"BCAD",
"BEUR",
"BIDR",
"BINR",
"BKRW",
"BMXN",
}
if currency_symbol not in ALLOWED_TOKENS:
currency_symbol = "UNKNOWN"
except UnicodeDecodeError:
await confirm_blind_sign_common(ctx, address, tx_bytes)
return blake2b(data=tx_bytes, outlen=32).digest()
else:
await confirm_blind_sign_common(ctx, address, tx_bytes)
return blake2b(data=tx_bytes, outlen=32).digest()

parsed_tx = parser.parse_tx(tx_bytes)
if parsed_tx is None:
await confirm_blind_sign_common(ctx, address, tx_bytes)
return blake2b(data=tx_bytes, outlen=32).digest()

is_valid = validate_transaction(parsed_tx)

if is_valid:
(
amount_raw,
recipient_bfc,
sender_bfc,
max_gas_fee,
) = parse_transaction(parsed_tx)
show_details = await require_show_overview(
ctx,
recipient_bfc,
amount_raw,
currency_symbol,
)
if show_details:
await require_confirm_fee(
ctx,
from_address=sender_bfc,
to_address=recipient_bfc,
value=amount_raw,
gas_price=max_gas_fee,
gas_budget=max_gas_fee,
currency_symbol=currency_symbol,
)
else:
await confirm_blind_sign_common(ctx, address, tx_bytes)
await confirm_blind_sign_common(ctx, address, tx_bytes)
return blake2b(data=tx_bytes, outlen=32).digest()


Expand Down
Loading