diff --git a/app/Makefile.version b/app/Makefile.version index 75c17110..a7822f19 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=2 # This is the `spec_version` field of `Runtime` APPVERSION_N=3 # This is the patch version of this release -APPVERSION_P=1 +APPVERSION_P=2 diff --git a/app/cosmos.png b/app/cosmos.png deleted file mode 100644 index fd8f6dbe..00000000 Binary files a/app/cosmos.png and /dev/null differ diff --git a/app/glyphs/icon_stax_32.gif b/app/glyphs/icon_stax_32.gif index bd338188..1b8f3428 100644 Binary files a/app/glyphs/icon_stax_32.gif and b/app/glyphs/icon_stax_32.gif differ diff --git a/app/glyphs/icon_stax_64.gif b/app/glyphs/icon_stax_64.gif index 64dee01b..33d48a9a 100644 Binary files a/app/glyphs/icon_stax_64.gif and b/app/glyphs/icon_stax_64.gif differ diff --git a/app/nanos_icon.gif b/app/nanos_icon.gif index 4f7d7164..5f5c1e7c 100644 Binary files a/app/nanos_icon.gif and b/app/nanos_icon.gif differ diff --git a/app/nanox_icon.gif b/app/nanox_icon.gif index 742043fc..cde2b75b 100644 Binary files a/app/nanox_icon.gif and b/app/nanox_icon.gif differ diff --git a/app/src/json/json_parser.c b/app/src/json/json_parser.c index 65ce9a72..690d545e 100644 --- a/app/src/json/json_parser.c +++ b/app/src/json/json_parser.c @@ -112,10 +112,6 @@ parser_error_t array_get_nth_element(const parsed_json_t *json, uint16_t array_token_index, uint16_t element_index, uint16_t *token_index) { - if (array_token_index < 0 || array_token_index > json->numberOfTokens) { - return parser_no_data; - } - jsmntok_t array_token = json->tokens[array_token_index]; *token_index = array_token_index; @@ -147,10 +143,6 @@ parser_error_t object_get_element_count(const parsed_json_t *json, uint16_t object_token_index, uint16_t *element_count) { *element_count = 0; - if (object_token_index < 0 || object_token_index > json->numberOfTokens) { - return parser_no_data; - } - jsmntok_t object_token = json->tokens[object_token_index]; uint16_t token_index = object_token_index; uint16_t prev_element_end = object_token.start; @@ -179,10 +171,6 @@ parser_error_t object_get_nth_key(const parsed_json_t *json, uint16_t object_element_index, uint16_t *token_index) { *token_index = object_token_index; - if (object_token_index < 0 || object_token_index > json->numberOfTokens) { - return parser_no_data; - } - jsmntok_t object_token = json->tokens[object_token_index]; uint16_t element_count = 0; uint16_t prev_element_end = object_token.start; @@ -214,10 +202,6 @@ parser_error_t object_get_nth_value(const parsed_json_t *json, uint16_t object_token_index, uint16_t object_element_index, uint16_t *key_index) { - if (object_token_index < 0 || object_token_index > json->numberOfTokens) { - return parser_no_data; - } - CHECK_PARSER_ERR(object_get_nth_key(json, object_token_index, object_element_index, key_index)) (*key_index)++; @@ -228,10 +212,6 @@ parser_error_t object_get_value(const parsed_json_t *json, uint16_t object_token_index, const char *key_name, uint16_t *token_index) { - if (object_token_index < 0 || object_token_index > json->numberOfTokens) { - return parser_no_data; - } - const jsmntok_t object_token = json->tokens[object_token_index]; *token_index = object_token_index; diff --git a/app/src/tx_display.c b/app/src/tx_display.c index 87dc5fd4..1b5e6d56 100644 --- a/app/src/tx_display.c +++ b/app/src/tx_display.c @@ -15,7 +15,6 @@ ********************************************************************************/ #ifdef __cplusplus #pragma clang diagnostic push -#pragma ide diagnostic ignored "misc-no-recursion" #endif #include "coin.h" @@ -58,7 +57,6 @@ const char *get_required_root_item(root_item_e i) { #ifdef __cplusplus #pragma clang diagnostic push -#pragma ide diagnostic ignored "bugprone-branch-clone" #endif __Z_INLINE uint8_t get_root_max_level(root_item_e i) { diff --git a/app/src/tx_parser.h b/app/src/tx_parser.h index 2bebc3ad..c4473f08 100644 --- a/app/src/tx_parser.h +++ b/app/src/tx_parser.h @@ -17,7 +17,6 @@ #ifdef __cplusplus #pragma clang diagnostic push -#pragma ide diagnostic ignored "modernize-deprecated-headers" #endif #include "json/json_parser.h" diff --git a/app/src/tx_validate.c b/app/src/tx_validate.c index 2eed930a..df5446b4 100644 --- a/app/src/tx_validate.c +++ b/app/src/tx_validate.c @@ -39,7 +39,7 @@ int8_t is_space(char c) { int8_t contains_whitespace(parsed_json_t *json) { if (json == NULL){ - return 1; + return 2; } int start = 0; @@ -132,10 +132,16 @@ int8_t dictionaries_sorted(parsed_json_t *json) { } parser_error_t tx_validate(parsed_json_t *json) { - if (contains_whitespace(json) == 1) { + int8_t whitespace_check = contains_whitespace(json); + + if (whitespace_check == 1) { return parser_json_contains_whitespace; } + if (whitespace_check == 2) { + return parser_json_unexpected_error; + } + if (dictionaries_sorted(json) != 1) { return parser_json_is_not_sorted; } diff --git a/app/thorchain.png b/app/thorchain.png new file mode 100644 index 00000000..08cad8ff Binary files /dev/null and b/app/thorchain.png differ diff --git a/tests_zemu/snapshots/st-sign_msgDeposit/00000.png b/tests_zemu/snapshots/st-sign_msgDeposit/00000.png index c1874b1e..35a1ffa1 100644 Binary files a/tests_zemu/snapshots/st-sign_msgDeposit/00000.png and b/tests_zemu/snapshots/st-sign_msgDeposit/00000.png differ diff --git a/tests_zemu/snapshots/st-sign_msgDeposit/00003.png b/tests_zemu/snapshots/st-sign_msgDeposit/00003.png index f384cce6..26c0cf9f 100644 Binary files a/tests_zemu/snapshots/st-sign_msgDeposit/00003.png and b/tests_zemu/snapshots/st-sign_msgDeposit/00003.png differ diff --git a/tests_zemu/snapshots/st-sign_msgDeposit/00004.png b/tests_zemu/snapshots/st-sign_msgDeposit/00004.png index a4630a5a..851d38e3 100644 Binary files a/tests_zemu/snapshots/st-sign_msgDeposit/00004.png and b/tests_zemu/snapshots/st-sign_msgDeposit/00004.png differ diff --git a/tests_zemu/snapshots/st-sign_msgSend/00000.png b/tests_zemu/snapshots/st-sign_msgSend/00000.png index c1874b1e..35a1ffa1 100644 Binary files a/tests_zemu/snapshots/st-sign_msgSend/00000.png and b/tests_zemu/snapshots/st-sign_msgSend/00000.png differ diff --git a/tests_zemu/snapshots/st-sign_msgSend/00003.png b/tests_zemu/snapshots/st-sign_msgSend/00003.png index f384cce6..26c0cf9f 100644 Binary files a/tests_zemu/snapshots/st-sign_msgSend/00003.png and b/tests_zemu/snapshots/st-sign_msgSend/00003.png differ diff --git a/tests_zemu/snapshots/st-sign_msgSend/00004.png b/tests_zemu/snapshots/st-sign_msgSend/00004.png index a4630a5a..851d38e3 100644 Binary files a/tests_zemu/snapshots/st-sign_msgSend/00004.png and b/tests_zemu/snapshots/st-sign_msgSend/00004.png differ