diff --git a/.gitignore b/.gitignore index 684c322..8c503d7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ debug/ dep/ obj/ build/ +.vscode/settings.json # Unit tests and code coverage unit-tests/build/ diff --git a/Makefile b/Makefile index 61a9937..6fe406f 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ # Application version APPVERSION_M = 0 APPVERSION_N = 1 -APPVERSION_P = 1 +APPVERSION_P = 2 APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" # Setting to allow building variant applications diff --git a/src/display.c b/src/display.c index 963b74b..adbe000 100644 --- a/src/display.c +++ b/src/display.c @@ -16,17 +16,18 @@ static void review_choice(bool approved) { } } -#define MAX_N_PAIRS 4; +#define MAX_N_PAIRS 4 + +// These are kept static rather than on the stack because the NBGL library +// stores pointers to them that must remain valid long term. +static nbgl_layoutTagValue_t pairs[MAX_N_PAIRS]; +static nbgl_layoutTagValueList_t pairList; +static char value_str[32], magic_value_str[32], fee_str[32]; bool display_transaction(dispatcher_context_t *dc, int64_t value_spent, uint64_t magic_input_value, uint64_t fee) { - nbgl_layoutTagValue_t pairs[4]; - nbgl_layoutTagValueList_t pairList; - - // format value_spent - char value_str[32], magic_value_str[32], fee_str[32]; uint64_t value_spent_abs = value_spent < 0 ? -value_spent : value_spent; format_sats_amount(COIN_COINID_SHORT, value_spent_abs, value_str); format_sats_amount(COIN_COINID_SHORT, magic_input_value, magic_value_str); diff --git a/src/main.c b/src/main.c index 8d7fdaf..1ada67b 100644 --- a/src/main.c +++ b/src/main.c @@ -106,7 +106,8 @@ static bool validate_transaction(dispatcher_context_t *dc, sizeof(witness_utxo))) { PRINTF("Failed to get witness utxo, or invalid witness utxo\n"); SEND_SW(dc, SW_INCORRECT_DATA); - }; + return false; + } if (witness_utxo[8] != 34) { PRINTF("Unexpected scriptPubKey length in witness utxo: %d\n", witness_utxo[8]); SEND_SW(dc, SW_INCORRECT_DATA); diff --git a/tests/snapshots/apex_p/test_dashboard_main/00001.png b/tests/snapshots/apex_p/test_dashboard_main/00001.png index f307fdd..6a4b436 100644 Binary files a/tests/snapshots/apex_p/test_dashboard_main/00001.png and b/tests/snapshots/apex_p/test_dashboard_main/00001.png differ diff --git a/tests/snapshots/apex_p/test_dashboard_test/00001.png b/tests/snapshots/apex_p/test_dashboard_test/00001.png index 975b2f8..8ae5c95 100644 Binary files a/tests/snapshots/apex_p/test_dashboard_test/00001.png and b/tests/snapshots/apex_p/test_dashboard_test/00001.png differ diff --git a/tests/snapshots/flex/test_dashboard_main/00001.png b/tests/snapshots/flex/test_dashboard_main/00001.png index c9059be..dacd435 100644 Binary files a/tests/snapshots/flex/test_dashboard_main/00001.png and b/tests/snapshots/flex/test_dashboard_main/00001.png differ diff --git a/tests/snapshots/flex/test_dashboard_test/00001.png b/tests/snapshots/flex/test_dashboard_test/00001.png index 07495a5..e31a501 100644 Binary files a/tests/snapshots/flex/test_dashboard_test/00001.png and b/tests/snapshots/flex/test_dashboard_test/00001.png differ diff --git a/tests/snapshots/stax/test_dashboard_main/00001.png b/tests/snapshots/stax/test_dashboard_main/00001.png index 4b515b0..627f9a6 100644 Binary files a/tests/snapshots/stax/test_dashboard_main/00001.png and b/tests/snapshots/stax/test_dashboard_main/00001.png differ diff --git a/tests/snapshots/stax/test_dashboard_test/00001.png b/tests/snapshots/stax/test_dashboard_test/00001.png index ea7bf37..efbed23 100644 Binary files a/tests/snapshots/stax/test_dashboard_test/00001.png and b/tests/snapshots/stax/test_dashboard_test/00001.png differ