Skip to content
Closed
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.1]

### Fixed

- Amount displayed for tokens with non-8 decimals.

## [0.10.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ APPNAME = "Aptos"
# Application version
APPVERSION_M = 0
APPVERSION_N = 10
APPVERSION_P = 0
APPVERSION_P = 1
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

# Application source files
Expand Down
61 changes: 56 additions & 5 deletions src/ui/common_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,177 +52,228 @@ int g_is_token_listed;
// Mapping to facilitate identification of Tickers and Token Names via the Coin Type id
typedef struct token_info {
const char ticker[MAX_TICKER_LENG];
uint8_t decimals;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root cause is a hardcoded static registry, so the wrong-amount bug recurs whenever the token list changes, and only one FA snapshot (test_sign_fa_tx) guards it. Could you add a short comment documenting where these decimals values come from (on-chain metadata source)? Not blocking.

const char coin_type[MAX_COIN_TYPE_LEN];
const char token[MAX_TOKEN_LEN];
} token_info_t;

// decimals mirror each token's on-chain metadata (the coin/fungible-asset
// `decimals`); keep in sync with the registry when the token list changes.
static const token_info_t TOKEN_MAPPING[] = {
{.ticker = "amAPT",
.decimals = 8,
.token = "Amnis Aptos Coin",
.coin_type = "0x111ae3e5bc816a5e63c2da97d0aa3886519e0cd5e4b046659fa35796bd11542a::amapt_token:"
":AmnisApt"},
{.ticker = "APARTMENT",
.decimals = 8,
.token = "Apartment",
.coin_type = "0x7b7bab2131de3e4f318b4abaa952f7c817b2c3df16c951caca809ac9ca9b650e::APARTMENT::"
"APARTMENT"},
{.ticker = "APE",
.decimals = 8,
.token = "APETOS",
.coin_type = "0xada35ada7e43e2ee1c39633ffccec38b76ce702b4efc2e60b50f63fbe4f710d8::apetos_"
"token::ApetosCoin"},
{.ticker = "APT", .token = "Aptos Coin", .coin_type = "0x1::aptos_coin::AptosCoin"},
{.ticker = "APT",
.decimals = 8,
.token = "Aptos Coin",
.coin_type = "0x1::aptos_coin::AptosCoin"},
{.ticker = "FOMO",
.decimals = 6,
.token = "APTOS FOMO",
.coin_type = "0xf891d2e004973430cc2bbbee69f3d0f4adb9c7ae03137b4579f7bb9979283ee6::APTOS_FOMO::"
"APTOS_FOMO"},
{.ticker = "ALT",
.decimals = 8,
.token = "Aptos Launch Token",
.coin_type =
"0xd0b4efb4be7c3508d9a26a9b5405cf9f860d0b9e5fe2f498b90e68b8d2cedd3e::aptos_launch_token::"
"AptosLaunchToken"},
{.ticker = "BLT",
.decimals = 8,
.token = "Blocto Token",
.coin_type = "0xfbab9fb68bd2103925317b6a540baa20087b1e7a7a4eb90badee04abb6b5a16f::blt::Blt"},
{.ticker = "MOVE",
.decimals = 8,
.token = "BlueMove",
.coin_type =
"0x27fafcc4e39daac97556af8a803dbb52bcb03f0821898dc845ac54225b9793eb::move_coin::MoveCoin"},
{.ticker = "BUBBLES",
.decimals = 8,
.token = "BUBBLES",
.coin_type = "0xd6a49762f6e4f7401ee79be6f5d4111e70db1408966ba1aa204e6e10c9d437ca::bubbles::"
"BubblesCoin"},
{.ticker = "doodoo",
.decimals = 8,
.token = "DooDoo",
.coin_type =
"0x73eb84966be67e4697fc5ae75173ca6c35089e802650f75422ab49a8729704ec::coin::DooDoo"},
{.ticker = "dstAPT",
.decimals = 8,
.token = "dstAPT",
.coin_type = "0xd11107bdf0d6d7040c6c0bfbdecb6545191fdf13e8d8d259952f53e1713f61b5::staked_coin:"
":StakedAptos"},
{.ticker = "whGARI",
.decimals = 8,
.token = "Gari (Wormhole)",
.coin_type = "0x4def3d3dee27308886f0a3611dd161ce34f977a9a5de4e80b237225923492a2a::coin::T"},
{.ticker = "GUI",
.decimals = 6,
.token = "Gui Inu",
.coin_type = "0xe4ccb6d39136469f376242c31b34d10515c8eaaa38092f804db8e08a8f53c5b2::assets_v1::"
"EchoCoin002"},
{.ticker = "HEART",
.decimals = 8,
.token = "HEART",
.coin_type =
"0x7de3fea83cd5ca0e1def27c3f3803af619882db51f34abf30dd04ad12ee6af31::tapos::Heart"},
{.ticker = "LSD",
.decimals = 8,
.token = "Liquidswap",
.coin_type = "0x53a30a6e5936c0a4c5140daed34de39d17ca7fcae08f947c02e979cef98a3719::coin::LSD"},
{.ticker = "MOJO",
.decimals = 8,
.token = "Mojito",
.coin_type = "0x881ac202b1f1e6ad4efcff7a1d0579411533f2502417a19211cfc49751ddb5f4::coin::MOJO"},
{.ticker = "MOOMOO",
.decimals = 6,
.token = "MOO MOO",
.coin_type =
"0xc5fbbcc4637aeebb4e732767abee8a21f2b0776f73b73e16ce13e7d31d6700da::MOOMOO::MOOMOO"},
{.ticker = "MOD",
.decimals = 8,
.token = "Move Dollar",
.coin_type =
"0x6f986d146e4a90b828d8c12c14b6f4e003fdff11a8eecceceb63744363eaac01::mod_coin::MOD"},
{.ticker = "Cake",
.decimals = 8,
.token = "PancakeSwap Token",
.coin_type =
"0x159df6b7689437016108a019fd5bef736bac692b6d4a1f10c941f6fbb9a74ca6::oft::CakeOFT"},
{.ticker = "RETuRD",
.decimals = 8,
.token = "Returd",
.coin_type =
"0xdf3d5eb83df80dfde8ceb1edaa24d8dbc46da6a89ae134a858338e1b86a29e38::coin::Returd"},
{.ticker = "SHRIMP",
.decimals = 2,
.token = "SHRIMP",
.coin_type =
"0x55987edfab9a57f69bac759674f139ae473b5e09a9283848c1f87faf6fc1e789::shrimp::ShrimpCoin"},
{.ticker = "whSOL",
.decimals = 8,
.token = "Solana (Wormhole)",
.coin_type = "0xdd89c0e695df0692205912fb69fc290418bed0dbe6e4573d744a6d5e6bab6c13::coin::T"},
{.ticker = "stAPT",
.decimals = 8,
.token = "Staked Aptos Coin",
.coin_type = "0x111ae3e5bc816a5e63c2da97d0aa3886519e0cd5e4b046659fa35796bd11542a::stapt_token:"
":StakedApt"},
{.ticker = "sthAPT",
.decimals = 8,
.token = "Staked Thala APT",
.coin_type = "0xfaf4e633ae9eb31366c9ca24214231760926576c7b625313b3688b5e900731f6::staking::"
"StakedThalaAPT"},
{.ticker = "ceUSDT",
.decimals = 6,
.token = "Tether USD (Celer)",
.coin_type = "0x8d87a65ba30e09357fa2edea2c80dbac296e5dec2b18287113500b902942929d::celer_coin_"
"manager::UsdtCoin"},
{.ticker = "lzUSDT",
.decimals = 6,
.token = "Tether USD (LayerZero)",
.coin_type =
"0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa::asset::USDT"},
{.ticker = "whUSDT",
.decimals = 6,
.token = "Tether USD (Wormhole)",
.coin_type = "0xa2eda21a58856fda86451436513b867c97eecb4ba099da5775520e0f7492e852::coin::T"},
{.ticker = "thAPT",
.decimals = 8,
.token = "Thala APT",
.coin_type =
"0xfaf4e633ae9eb31366c9ca24214231760926576c7b625313b3688b5e900731f6::staking::ThalaAPT"},
{.ticker = "THL",
.decimals = 8,
.token = "Thala Token",
.coin_type =
"0x7fd500c11216f0fe3095d0c4b8aa4d64a4e2e04f83758462f2b127255643615::thl_coin::THL"},
{.ticker = "LOON",
.decimals = 6,
.token = "The Loonies",
.coin_type = "0x268d4a7a2ad93274edf6116f9f20ad8455223a7ab5fc73154f687e7dbc3e3ec6::LOON::LOON"},
{.ticker = "TIN",
.decimals = 8,
.token = "Token \"IN\"",
.coin_type =
"0xc32ba5d293577cbb1df390f35b2bc6369a593b736d0865fedec1a2b08565de8e::in_coin::InCoin"},
{.ticker = "TOMA",
.decimals = 6,
.token = "Tomarket",
.coin_type =
"0x9d0595765a31f8d56e1d2aafc4d6c76f283c67a074ef8812d8c31bd8252ac2c3::asset::TOMA"},
{.ticker = "tAPT",
.decimals = 8,
.token = "Tortuga Staked APT",
.coin_type =
"0x84d7aeef42d38a5ffc3ccef853e1b82e4958659d16a7de736a29c55fbbeb0114::staked_aptos_coin::"
"StakedAptosCoin"},
{.ticker = "UPTOS",
.decimals = 8,
.token = "UPTOS",
.coin_type =
"0x4fbed3f8a3fd8a11081c8b6392152a8b0cb14d70d0414586f0c9b858fcd2d6a7::UPTOS::UPTOS"},
{.ticker = "lzUSDC",
.decimals = 6,
.token = "USD Coin (LayerZero)",
.coin_type =
"0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa::asset::USDC"},
{.ticker = "whUSDC",
.decimals = 6,
.token = "USD Coin (Wormhole)",
.coin_type = "0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T"},
{.ticker = "ceWBNB",
.decimals = 8,
.token = "Wrapped BNB (Celer)",
.coin_type = "0x8d87a65ba30e09357fa2edea2c80dbac296e5dec2b18287113500b902942929d::celer_coin_"
"manager::BnbCoin"},
{.ticker = "lzWETH",
.decimals = 6,
.token = "Wrapped Ether (LayerZero)",
.coin_type =
"0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa::asset::WETH"},
{.ticker = "whWETH",
.decimals = 8,
.token = "Wrapped Ether (Wormhole)",
.coin_type = "0xcc8a89c8dce9693d354449f1f73e60e14e347417854f029db5bc8e7454008abb::coin::T"},
{.ticker = "ANI",
.decimals = 8,
.token = "AnimeSwap Coin",
.coin_type =
"0x16fe2df00ea7dde4a63409201f7f4e536bde7bb7335526a35d05111e68aa322c::AnimeCoin::ANI"},
{.ticker = "AMA",
.decimals = 8,
.token = "Amaterasu",
.coin_type = "0xd0ab8c2f76cd640455db56ca758a9766a966c88f77920347aac1719edab1df5e"},
{.ticker = "CELL",
.decimals = 8,
.token = "CELLANA",
.coin_type = "0x2ebb2ccac5e027a87fa0e2e5f656a3a4238d6a48d93ec9b610d570fc0aa0df12"},
{.ticker = "MKL",
.decimals = 6,
.token = "MKL",
.coin_type = "0x878370592f9129e14b76558689a4b570ad22678111df775befbfcbc9fb3d90ab"},
{.ticker = "USDT",
.decimals = 6,
.token = "Tether USD",
.coin_type = "0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b"},
{.ticker = "TruAPT",
.decimals = 8,
.token = "TruAPT coin",
.coin_type = "0xaef6a8c3182e076db72d64324617114cacf9a52f28325edc10b483f7f05da0e7"},
{.ticker = "USDC",
.decimals = 6,
.token = "USDC",
.coin_type = "0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b"}};

Expand Down Expand Up @@ -456,11 +507,11 @@ int ui_prepare_tx_coin_transfer() {
PRINTF("Receiver: %s\n", g_address);

memset(g_amount, 0, sizeof(g_amount));
const token_info_t *info = get_token_info(g_struct);
char amount[30] = {0};
if (!format_fpu64(amount, sizeof(amount), transfer->amount, 8)) {
if (!format_fpu64(amount, sizeof(amount), transfer->amount, info ? info->decimals : 8)) {
return io_send_sw(SW_DISPLAY_AMOUNT_FAIL);
}
const token_info_t *info = get_token_info(g_struct);
if (info) {
snprintf(g_amount, sizeof(g_amount), "%s %.*s", info->ticker, sizeof(amount), amount);
g_is_token_listed = 1;
Expand Down Expand Up @@ -501,11 +552,11 @@ int ui_prepare_tx_fungible_asset_transfer() {
}
PRINTF("Receiver: %s\n", g_address);

const token_info_t *info = get_token_info(g_struct);
char amount[30] = {0};
if (!format_fpu64(amount, sizeof(amount), transfer->amount, 8)) {
if (!format_fpu64(amount, sizeof(amount), transfer->amount, info ? info->decimals : 8)) {
return io_send_sw(SW_DISPLAY_AMOUNT_FAIL);
}
const token_info_t *info = get_token_info(g_struct);
if (info) {
snprintf(g_amount, sizeof(g_amount), "%s %.*s", info->ticker, sizeof(amount), amount);
g_is_token_listed = 1;
Expand Down
Binary file modified tests/snapshots/apex_p/test_app_mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/apex_p/test_sign_fa_tx/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_app_mainmenu/00007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part0/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part0/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part0/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part0/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part0/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part1/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part1/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part1/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part1/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part1/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part1/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_blind_sign_tx_long_tx/part1/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/flex/test_sign_fa_tx/00000.png
Binary file modified tests/snapshots/flex/test_sign_fa_tx/00001.png
Binary file modified tests/snapshots/flex/test_sign_fa_tx/00002.png
Binary file modified tests/snapshots/flex/test_sign_fa_tx/00003.png
Binary file modified tests/snapshots/flex/test_sign_fa_tx/00004.png
Binary file modified tests/snapshots/flex/test_sign_fa_tx/00005.png
Binary file modified tests/snapshots/flex/test_sign_listed_legacy_tokens/00000.png
Binary file modified tests/snapshots/flex/test_sign_listed_legacy_tokens/00001.png
Binary file modified tests/snapshots/flex/test_sign_listed_legacy_tokens/00002.png
Binary file modified tests/snapshots/flex/test_sign_listed_legacy_tokens/00003.png
Binary file modified tests/snapshots/flex/test_sign_listed_legacy_tokens/00004.png
Binary file modified tests/snapshots/flex/test_sign_listed_legacy_tokens/00005.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part0/00000.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part0/00001.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part0/00002.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part0/00003.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part0/00004.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part1/00000.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part1/00001.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part1/00002.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part1/00003.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part1/00004.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part1/00005.png
Binary file modified tests/snapshots/flex/test_sign_long_raw_msg/part1/00006.png
Binary file modified tests/snapshots/flex/test_sign_reactivate_aptos/00000.png
Binary file modified tests/snapshots/flex/test_sign_reactivate_aptos/00001.png
Binary file modified tests/snapshots/flex/test_sign_reactivate_aptos/00002.png
Binary file modified tests/snapshots/flex/test_sign_reactivate_aptos/00003.png
Binary file modified tests/snapshots/flex/test_sign_reactivate_aptos/00004.png
Binary file modified tests/snapshots/flex/test_sign_short_raw_msg/00000.png
Binary file modified tests/snapshots/flex/test_sign_short_raw_msg/00001.png
Binary file modified tests/snapshots/flex/test_sign_short_raw_msg/00002.png
Binary file modified tests/snapshots/flex/test_sign_short_raw_msg/00003.png
Binary file modified tests/snapshots/flex/test_sign_short_raw_msg/00004.png
Binary file modified tests/snapshots/flex/test_sign_staking_aptos/00000.png
Binary file modified tests/snapshots/flex/test_sign_staking_aptos/00001.png
Binary file modified tests/snapshots/flex/test_sign_staking_aptos/00002.png
Binary file modified tests/snapshots/flex/test_sign_staking_aptos/00003.png
Binary file modified tests/snapshots/flex/test_sign_staking_aptos/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part0/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part0/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part1/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part1/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part1/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part2/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part2/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part2/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part2/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part3/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part3/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part3/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part3/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_refused/part3/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_msg/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_msg/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_msg/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_msg/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_msg/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx/00000.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx/00001.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx/00002.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx/00003.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx/00004.png
Binary file modified tests/snapshots/flex/test_sign_tx_short_tx/00005.png
Binary file modified tests/snapshots/flex/test_sign_unlisted_legacy_tokens/00000.png
Binary file modified tests/snapshots/flex/test_sign_unlisted_legacy_tokens/00001.png
Binary file modified tests/snapshots/flex/test_sign_unlisted_legacy_tokens/00002.png
Binary file modified tests/snapshots/flex/test_sign_unlisted_legacy_tokens/00003.png
Binary file modified tests/snapshots/flex/test_sign_unlisted_legacy_tokens/00004.png
Binary file modified tests/snapshots/flex/test_sign_unlisted_legacy_tokens/00005.png
Binary file modified tests/snapshots/flex/test_sign_unlisted_legacy_tokens/00006.png
Binary file modified tests/snapshots/flex/test_sign_unlocking_aptos/00000.png
Binary file modified tests/snapshots/flex/test_sign_unlocking_aptos/00001.png
Binary file modified tests/snapshots/flex/test_sign_unlocking_aptos/00002.png
Binary file modified tests/snapshots/flex/test_sign_unlocking_aptos/00003.png
Binary file modified tests/snapshots/flex/test_sign_unlocking_aptos/00004.png
Binary file modified tests/snapshots/flex/test_sign_withdraw_aptos/00000.png
Binary file modified tests/snapshots/flex/test_sign_withdraw_aptos/00001.png
Binary file modified tests/snapshots/flex/test_sign_withdraw_aptos/00002.png
Binary file modified tests/snapshots/flex/test_sign_withdraw_aptos/00003.png
Binary file modified tests/snapshots/flex/test_sign_withdraw_aptos/00004.png
Binary file modified tests/snapshots/nanosp/test_sign_fa_tx/00003.png
Binary file modified tests/snapshots/nanox/test_sign_fa_tx/00003.png
Binary file modified tests/snapshots/stax/test_app_mainmenu/00004.png
Binary file modified tests/snapshots/stax/test_blind_sign_tx_long_tx/part0/00001.png
Binary file modified tests/snapshots/stax/test_blind_sign_tx_long_tx/part0/00003.png
Binary file modified tests/snapshots/stax/test_blind_sign_tx_long_tx/part1/00000.png
Binary file modified tests/snapshots/stax/test_blind_sign_tx_long_tx/part1/00002.png
Binary file modified tests/snapshots/stax/test_blind_sign_tx_long_tx/part1/00004.png
Binary file modified tests/snapshots/stax/test_blind_sign_tx_long_tx/part1/00005.png
Binary file modified tests/snapshots/stax/test_sign_fa_tx/00001.png
Binary file modified tests/snapshots/stax/test_sign_fa_tx/00003.png
Binary file modified tests/snapshots/stax/test_sign_fa_tx/00004.png
Binary file modified tests/snapshots/stax/test_sign_listed_legacy_tokens/00003.png
Binary file modified tests/snapshots/stax/test_sign_listed_legacy_tokens/00004.png
Binary file modified tests/snapshots/stax/test_sign_long_raw_msg/part0/00001.png
Binary file modified tests/snapshots/stax/test_sign_long_raw_msg/part0/00003.png
Binary file modified tests/snapshots/stax/test_sign_long_raw_msg/part1/00000.png
Binary file modified tests/snapshots/stax/test_sign_long_raw_msg/part1/00002.png
Binary file modified tests/snapshots/stax/test_sign_long_raw_msg/part1/00004.png
Binary file modified tests/snapshots/stax/test_sign_long_raw_msg/part1/00005.png
Binary file modified tests/snapshots/stax/test_sign_reactivate_aptos/00002.png
Binary file modified tests/snapshots/stax/test_sign_reactivate_aptos/00003.png
Binary file modified tests/snapshots/stax/test_sign_short_raw_msg/00002.png
Binary file modified tests/snapshots/stax/test_sign_short_raw_msg/00003.png
Binary file modified tests/snapshots/stax/test_sign_staking_aptos/00002.png
Binary file modified tests/snapshots/stax/test_sign_staking_aptos/00003.png
Binary file modified tests/snapshots/stax/test_sign_tx_refused/part3/00003.png
Binary file modified tests/snapshots/stax/test_sign_tx_short_msg/00002.png
Binary file modified tests/snapshots/stax/test_sign_tx_short_msg/00003.png
Binary file modified tests/snapshots/stax/test_sign_tx_short_tx/00003.png
Binary file modified tests/snapshots/stax/test_sign_tx_short_tx/00004.png
Binary file modified tests/snapshots/stax/test_sign_unlisted_legacy_tokens/00003.png
Binary file modified tests/snapshots/stax/test_sign_unlisted_legacy_tokens/00004.png
Binary file modified tests/snapshots/stax/test_sign_unlocking_aptos/00002.png
Binary file modified tests/snapshots/stax/test_sign_unlocking_aptos/00003.png
Binary file modified tests/snapshots/stax/test_sign_withdraw_aptos/00002.png
Binary file modified tests/snapshots/stax/test_sign_withdraw_aptos/00003.png
7 changes: 6 additions & 1 deletion tests/test_pubkey_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_get_public_key_confirm_refused(firmware, backend, navigator, test_name)
NavInsID.USE_CASE_STATUS_DISMISS
],
[
NavInsID.USE_CASE_VIEW_DETAILS_NEXT,
NavInsID.USE_CASE_REVIEW_NEXT,
NavInsID.USE_CASE_ADDRESS_CONFIRMATION_CANCEL,
NavInsID.USE_CASE_STATUS_DISMISS
]
Expand All @@ -104,3 +104,8 @@ def test_get_public_key_confirm_refused(firmware, backend, navigator, test_name)
# Assert that we have received a refusal
assert e.value.status == Errors.SW_DENY
assert len(e.value.data) == 0
# Wait for the "canceled" status screen to fully dismiss back to the
# home screen before starting the next iteration. Otherwise its
# residual frame can bleed into the next navigation's first
# screenshot, producing flaky snapshot comparisons.
navigator.navigate([NavInsID.WAIT_FOR_HOME_SCREEN])
2 changes: 1 addition & 1 deletion unit-tests/test_tx_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static void test_transaction_utils_bcs_cmp_bytes(void **state) {
(void) state;

const uint8_t good_bytes[] = {0x48, 0x65, 0x6c, 0x6c, 0x6f}; // Hello
const fixed_bytes_t bcs_bytes = {.len = 5, .bytes = &good_bytes};
const fixed_bytes_t bcs_bytes = {.len = 5, .bytes = (uint8_t *)good_bytes};
const char good_str[] = "Hello";
const char bad_str[] = "Hello!";
assert_true(bcs_cmp_bytes(&bcs_bytes, good_str, strlen(good_str)));
Expand Down
Loading