diff --git a/app/Makefile.version b/app/Makefile.version index 75c1711..a7822f1 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 fd8f6db..0000000 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 bd33818..1b8f342 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 64dee01..33d48a9 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 4f7d716..5f5c1e7 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 742043f..cde2b75 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 65ce9a7..690d545 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 87dc5fd..1b5e6d5 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 2bebc3a..c4473f0 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 2eed930..df5446b 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 0000000..08cad8f 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 c1874b1..35a1ffa 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 f384cce..26c0cf9 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 a4630a5..851d38e 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 c1874b1..35a1ffa 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 f384cce..26c0cf9 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 a4630a5..851d38e 100644 Binary files a/tests_zemu/snapshots/st-sign_msgSend/00004.png and b/tests_zemu/snapshots/st-sign_msgSend/00004.png differ