diff --git a/app/Makefile b/app/Makefile index 3845ae9c..34a37920 100755 --- a/app/Makefile +++ b/app/Makefile @@ -89,17 +89,16 @@ $(info PATHS LIST = $(APPPATH)) APP_LOAD_PARAMS = --curve ed25519 $(COMMON_LOAD_PARAMS) --path $(APPPATH) -ifeq ($(TARGET_NAME),TARGET_NANOS) - APP_STACK_MIN_SIZE := 1600 -else - APP_STACK_MIN_SIZE := 1752 -endif - include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.devices -DEFAULT_ICON = nanos_$(ICON_NAME).gif +DEFAULT_NANOS_ICON = nanos_$(ICON_NAME).gif +DEFAULT_NBGL_ICON_32 = stax_$(ICON_NAME).gif +DEFAULT_NBGL_ICON_64 = stax_$(ICON_NAME)_64.gif + copy_icon: - cp $(DEFAULT_ICON) glyphs/icon_app.gif + cp $(DEFAULT_NANOS_ICON) glyphs/icon_app.gif + cp $(DEFAULT_NBGL_ICON_32) glyphs/icon_stax_32.gif + cp $(DEFAULT_NBGL_ICON_64) glyphs/icon_stax_64.gif all: copy_icon diff --git a/app/Makefile.version b/app/Makefile.version index b20579fa..2718d742 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=100 # This is the `spec_version` field of `Runtime` APPVERSION_N=0 # This is the patch version of this release -APPVERSION_P=5 +APPVERSION_P=8 diff --git a/app/flex_icon.gif b/app/flex_icon.gif new file mode 100644 index 00000000..71c3a055 Binary files /dev/null and b/app/flex_icon.gif differ diff --git a/app/flex_migration.gif b/app/flex_migration.gif new file mode 100644 index 00000000..d24bdb7d Binary files /dev/null and b/app/flex_migration.gif differ diff --git a/app/src/common/migration.c b/app/src/common/migration.c index b623614f..dce62e77 100644 --- a/app/src/common/migration.c +++ b/app/src/common/migration.c @@ -56,7 +56,7 @@ void migrationOk() { void migrationStartMessage() { #ifdef MIGRATION_APP -#ifdef TARGET_STAX +#if defined(TARGET_STAX) || defined(TARGET_FLEX) const review_type_e reviewType = REVIEW_UI; #else const review_type_e reviewType = REVIEW_MSG; diff --git a/app/src/common/tx.c b/app/src/common/tx.c index 17ab35f2..3a104776 100644 --- a/app/src/common/tx.c +++ b/app/src/common/tx.c @@ -28,7 +28,7 @@ extern uint16_t blobLen; -#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) +#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX) #define RAM_BUFFER_SIZE 16384 // 16 KiB #define FLASH_BUFFER_SIZE 16384 // 16 KiB #elif defined(TARGET_NANOS) @@ -44,7 +44,7 @@ typedef struct { uint8_t buffer[FLASH_BUFFER_SIZE]; } storage_t; -#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX) storage_t NV_CONST N_appdata_impl __attribute__((aligned(64))); #define N_appdata (*(NV_VOLATILE storage_t *)PIC(&N_appdata_impl)) #endif diff --git a/app/src/crypto_helper.c b/app/src/crypto_helper.c index 4f6cd487..1bcb6a5a 100644 --- a/app/src/crypto_helper.c +++ b/app/src/crypto_helper.c @@ -21,7 +21,7 @@ const unsigned char SS58_BLAKE_PREFIX[] = "SS58PRE"; #define SS58_BLAKE_PREFIX_LEN 7 -#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX) #include "cx.h" cx_err_t ss58hash(const unsigned char *in, unsigned int inLen, unsigned char *out, unsigned int outLen) { diff --git a/app/src/metadata_reader.c b/app/src/metadata_reader.c index 01df27ae..fa205652 100644 --- a/app/src/metadata_reader.c +++ b/app/src/metadata_reader.c @@ -28,7 +28,7 @@ #include "substrate_types.h" #include "zxmacros.h" -#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX) #define STACK_SHIFT 20 #define MINIMUM_STACK 400 #else @@ -42,7 +42,7 @@ static uint16_t recursionDepthCounter = 0; * @return parser_error_t Returns parser_running_out_of_stack if stack space is insufficient, otherwise parser_ok. */ parser_error_t checkStack() { -#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) +#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX) // NOLINTNEXTLINE(readability-identifier-length): here `p` is fine void *p = NULL; const uint32_t availableStack = (uint32_t)((void *)&p) + STACK_SHIFT - (uint32_t)&app_stack_canary; @@ -65,7 +65,8 @@ parser_error_t checkStack() { * @return parser_error_t Always returns parser_ok. */ parser_error_t freeStack() { -#if !defined(TARGET_NANOS) && !defined(TARGET_NANOX) && !defined(TARGET_NANOS2) && !defined(TARGET_STAX) +#if !defined(TARGET_NANOS) && !defined(TARGET_NANOX) && !defined(TARGET_NANOS2) && !defined(TARGET_STAX) && \ + !defined(TARGET_FLEX) if (recursionDepthCounter > 0) { recursionDepthCounter--; } diff --git a/app/stax_icon_64.gif b/app/stax_icon_64.gif new file mode 100644 index 00000000..3f402f27 Binary files /dev/null and b/app/stax_icon_64.gif differ diff --git a/app/stax_migration.gif b/app/stax_migration.gif index 979eee9e..b2deaa4a 100644 Binary files a/app/stax_migration.gif and b/app/stax_migration.gif differ diff --git a/app/stax_migration_64.gif b/app/stax_migration_64.gif new file mode 100644 index 00000000..7775cec4 Binary files /dev/null and b/app/stax_migration_64.gif differ diff --git a/deps/ledger-zxlib b/deps/ledger-zxlib index 6c1ef972..271f40ce 160000 --- a/deps/ledger-zxlib +++ b/deps/ledger-zxlib @@ -1 +1 @@ -Subproject commit 6c1ef9729af5621ec4031eaa0804e2f84aecbd98 +Subproject commit 271f40ce03219eac8396a309ce9704977cf59caa diff --git a/deps/nanos-secure-sdk b/deps/nanos-secure-sdk index 74ca336c..b9fa0e8d 160000 --- a/deps/nanos-secure-sdk +++ b/deps/nanos-secure-sdk @@ -1 +1 @@ -Subproject commit 74ca336caa23db2c64cc42424ac9e32f6988df09 +Subproject commit b9fa0e8dcffbdaa086b8a20bba1ae66a16c124fa diff --git a/deps/nanosplus-secure-sdk b/deps/nanosplus-secure-sdk index 3e726e74..b46b4b51 160000 --- a/deps/nanosplus-secure-sdk +++ b/deps/nanosplus-secure-sdk @@ -1 +1 @@ -Subproject commit 3e726e74daf9827663ad7003822d1d52fa17f035 +Subproject commit b46b4b516650c08dfe913054dc7535dd52e2503a diff --git a/deps/nanox-secure-sdk b/deps/nanox-secure-sdk index 3e726e74..b46b4b51 160000 --- a/deps/nanox-secure-sdk +++ b/deps/nanox-secure-sdk @@ -1 +1 @@ -Subproject commit 3e726e74daf9827663ad7003822d1d52fa17f035 +Subproject commit b46b4b516650c08dfe913054dc7535dd52e2503a diff --git a/deps/stax-secure-sdk b/deps/stax-secure-sdk index 3e726e74..b46b4b51 160000 --- a/deps/stax-secure-sdk +++ b/deps/stax-secure-sdk @@ -1 +1 @@ -Subproject commit 3e726e74daf9827663ad7003822d1d52fa17f035 +Subproject commit b46b4b516650c08dfe913054dc7535dd52e2503a diff --git a/ledger_app.toml b/ledger_app.toml index 3e4cbb1f..7f63dfec 100644 --- a/ledger_app.toml +++ b/ledger_app.toml @@ -1,7 +1,7 @@ [app] build_directory = "./app/" sdk = "C" -devices = ["nanos", "nanox", "nanos+", "stax"] +devices = ["nanos", "nanox", "nanos+", "stax", "flex"] [tests] unit_directory = "./tests/" diff --git a/tests_zemu/package.json b/tests_zemu/package.json index 85bf43cd..06f9e897 100644 --- a/tests_zemu/package.json +++ b/tests_zemu/package.json @@ -28,7 +28,7 @@ "dependencies": { "@zondax/ledger-js": "^0.10.0", "@zondax/ledger-substrate": "^0.44.3", - "@zondax/zemu": "^0.49.0" + "@zondax/zemu": "^0.50.2" }, "devDependencies": { "@ledgerhq/hw-transport-node-hid": "^6.29.0", @@ -37,8 +37,8 @@ "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@types/jest": "^29.5.12", "@types/ledgerhq__hw-transport": "^4.21.8", - "@typescript-eslint/eslint-plugin": "^7.14.1", - "@typescript-eslint/parser": "^7.14.1", + "@typescript-eslint/eslint-plugin": "^7.17.0", + "@typescript-eslint/parser": "^7.17.0", "blakejs": "^1.2.1", "crypto-js": "4.2.0", "ed25519-supercop": "^2.0.1", @@ -47,9 +47,9 @@ "eslint-plugin-import": "^2.29.1", "eslint-plugin-jest": "^28.6.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-promise": "^6.2.0", + "eslint-plugin-promise": "^6.6.0", "eslint-plugin-tsdoc": "^0.3.0", - "eslint-plugin-unused-imports": "^4.0.0", + "eslint-plugin-unused-imports": "^4.0.1", "jest": "29.7.0", "jssha": "^3.3.1", "prettier": "^3.3.2", diff --git a/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00000.png b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00000.png new file mode 100644 index 00000000..a107ccf7 Binary files /dev/null and b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00000.png differ diff --git a/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00001.png b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00001.png new file mode 100644 index 00000000..c44d507a Binary files /dev/null and b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00001.png differ diff --git a/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00002.png b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00002.png new file mode 100644 index 00000000..6ba78633 Binary files /dev/null and b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00002.png differ diff --git a/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00003.png b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00003.png new file mode 100644 index 00000000..36bc8d67 Binary files /dev/null and b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00003.png differ diff --git a/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00004.png b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00004.png new file mode 100644 index 00000000..ecf393b9 Binary files /dev/null and b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00004.png differ diff --git a/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00005.png b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00005.png new file mode 100644 index 00000000..0bf2215b Binary files /dev/null and b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00005.png differ diff --git a/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00006.png b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00006.png new file mode 100644 index 00000000..12b9d370 Binary files /dev/null and b/tests_zemu/snapshots/fl-balances_force_transfer_rococo/00006.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00000.png b/tests_zemu/snapshots/fl-mainmenu/00000.png new file mode 100644 index 00000000..12b9d370 Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00000.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00001.png b/tests_zemu/snapshots/fl-mainmenu/00001.png new file mode 100644 index 00000000..1c012457 Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00002.png b/tests_zemu/snapshots/fl-mainmenu/00002.png new file mode 100644 index 00000000..96493534 Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00002.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00003.png b/tests_zemu/snapshots/fl-mainmenu/00003.png new file mode 100644 index 00000000..1c012457 Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00003.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00004.png b/tests_zemu/snapshots/fl-mainmenu/00004.png new file mode 100644 index 00000000..db7f23b7 Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00005.png b/tests_zemu/snapshots/fl-mainmenu/00005.png new file mode 100644 index 00000000..890b74ca Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00005.png differ diff --git a/tests_zemu/snapshots/fl-mainmenu/00006.png b/tests_zemu/snapshots/fl-mainmenu/00006.png new file mode 100644 index 00000000..12b9d370 Binary files /dev/null and b/tests_zemu/snapshots/fl-mainmenu/00006.png differ diff --git a/tests_zemu/snapshots/fl-migration-mainmenu/00000.png b/tests_zemu/snapshots/fl-migration-mainmenu/00000.png new file mode 100644 index 00000000..5fddefaf Binary files /dev/null and b/tests_zemu/snapshots/fl-migration-mainmenu/00000.png differ diff --git a/tests_zemu/snapshots/fl-migration-mainmenu/00001.png b/tests_zemu/snapshots/fl-migration-mainmenu/00001.png new file mode 100644 index 00000000..507ca064 Binary files /dev/null and b/tests_zemu/snapshots/fl-migration-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/fl-migration-mainmenu/00002.png b/tests_zemu/snapshots/fl-migration-mainmenu/00002.png new file mode 100644 index 00000000..6cb4ba33 Binary files /dev/null and b/tests_zemu/snapshots/fl-migration-mainmenu/00002.png differ diff --git a/tests_zemu/snapshots/fl-raw_sign/00000.png b/tests_zemu/snapshots/fl-raw_sign/00000.png new file mode 100644 index 00000000..a5bc0a18 Binary files /dev/null and b/tests_zemu/snapshots/fl-raw_sign/00000.png differ diff --git a/tests_zemu/snapshots/fl-raw_sign/00001.png b/tests_zemu/snapshots/fl-raw_sign/00001.png new file mode 100644 index 00000000..975caeb7 Binary files /dev/null and b/tests_zemu/snapshots/fl-raw_sign/00001.png differ diff --git a/tests_zemu/snapshots/fl-raw_sign/00002.png b/tests_zemu/snapshots/fl-raw_sign/00002.png new file mode 100644 index 00000000..aaea04cb Binary files /dev/null and b/tests_zemu/snapshots/fl-raw_sign/00002.png differ diff --git a/tests_zemu/snapshots/fl-raw_sign/00003.png b/tests_zemu/snapshots/fl-raw_sign/00003.png new file mode 100644 index 00000000..12b9d370 Binary files /dev/null and b/tests_zemu/snapshots/fl-raw_sign/00003.png differ diff --git a/tests_zemu/snapshots/fl-raw_sign_hex/00000.png b/tests_zemu/snapshots/fl-raw_sign_hex/00000.png new file mode 100644 index 00000000..a5bc0a18 Binary files /dev/null and b/tests_zemu/snapshots/fl-raw_sign_hex/00000.png differ diff --git a/tests_zemu/snapshots/fl-raw_sign_hex/00001.png b/tests_zemu/snapshots/fl-raw_sign_hex/00001.png new file mode 100644 index 00000000..81380bbf Binary files /dev/null and b/tests_zemu/snapshots/fl-raw_sign_hex/00001.png differ diff --git a/tests_zemu/snapshots/fl-raw_sign_hex/00002.png b/tests_zemu/snapshots/fl-raw_sign_hex/00002.png new file mode 100644 index 00000000..aaea04cb Binary files /dev/null and b/tests_zemu/snapshots/fl-raw_sign_hex/00002.png differ diff --git a/tests_zemu/snapshots/fl-raw_sign_hex/00003.png b/tests_zemu/snapshots/fl-raw_sign_hex/00003.png new file mode 100644 index 00000000..12b9d370 Binary files /dev/null and b/tests_zemu/snapshots/fl-raw_sign_hex/00003.png differ diff --git a/tests_zemu/snapshots/fl-show_address/00000.png b/tests_zemu/snapshots/fl-show_address/00000.png new file mode 100644 index 00000000..b8f0c7f2 Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address/00000.png differ diff --git a/tests_zemu/snapshots/fl-show_address/00001.png b/tests_zemu/snapshots/fl-show_address/00001.png new file mode 100644 index 00000000..1eb1f8de Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address/00001.png differ diff --git a/tests_zemu/snapshots/fl-show_address/00002.png b/tests_zemu/snapshots/fl-show_address/00002.png new file mode 100644 index 00000000..18b4f4eb Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address/00002.png differ diff --git a/tests_zemu/snapshots/fl-show_address/00003.png b/tests_zemu/snapshots/fl-show_address/00003.png new file mode 100644 index 00000000..12b9d370 Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address/00003.png differ diff --git a/tests_zemu/snapshots/fl-show_address_reject/00000.png b/tests_zemu/snapshots/fl-show_address_reject/00000.png new file mode 100644 index 00000000..b8f0c7f2 Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address_reject/00000.png differ diff --git a/tests_zemu/snapshots/fl-show_address_reject/00001.png b/tests_zemu/snapshots/fl-show_address_reject/00001.png new file mode 100644 index 00000000..1eb1f8de Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address_reject/00001.png differ diff --git a/tests_zemu/snapshots/fl-show_address_reject/00002.png b/tests_zemu/snapshots/fl-show_address_reject/00002.png new file mode 100644 index 00000000..18b4f4eb Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address_reject/00002.png differ diff --git a/tests_zemu/snapshots/fl-show_address_reject/00003.png b/tests_zemu/snapshots/fl-show_address_reject/00003.png new file mode 100644 index 00000000..45c08d4e Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address_reject/00003.png differ diff --git a/tests_zemu/snapshots/fl-show_address_reject/00004.png b/tests_zemu/snapshots/fl-show_address_reject/00004.png new file mode 100644 index 00000000..12b9d370 Binary files /dev/null and b/tests_zemu/snapshots/fl-show_address_reject/00004.png differ diff --git a/tests_zemu/snapshots/s-mainmenu/00004.png b/tests_zemu/snapshots/s-mainmenu/00004.png index 538dda09..106ea2bf 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00004.png and b/tests_zemu/snapshots/s-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/s-mainmenu/00010.png b/tests_zemu/snapshots/s-mainmenu/00010.png index 538dda09..106ea2bf 100644 Binary files a/tests_zemu/snapshots/s-mainmenu/00010.png and b/tests_zemu/snapshots/s-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00004.png b/tests_zemu/snapshots/sp-mainmenu/00004.png index 84ef09ca..412f67a9 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00004.png and b/tests_zemu/snapshots/sp-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/sp-mainmenu/00010.png b/tests_zemu/snapshots/sp-mainmenu/00010.png index 84ef09ca..412f67a9 100644 Binary files a/tests_zemu/snapshots/sp-mainmenu/00010.png and b/tests_zemu/snapshots/sp-mainmenu/00010.png differ diff --git a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00000.png b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00000.png index a0814fb2..3abac735 100644 Binary files a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00000.png and b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00000.png differ diff --git a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00001.png b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00001.png index 25cdfcce..8b0efeab 100644 Binary files a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00001.png and b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00001.png differ diff --git a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00002.png b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00002.png index 098dd6c3..bf8c81c4 100644 Binary files a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00002.png and b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00002.png differ diff --git a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00003.png b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00003.png index f1b35c2d..7aa7f2c5 100644 Binary files a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00003.png and b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00003.png differ diff --git a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00004.png b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00004.png index 42878a77..496f8e48 100644 Binary files a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00004.png and b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00004.png differ diff --git a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00005.png b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00005.png index e9a56d60..48feb3b8 100644 Binary files a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00005.png and b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00005.png differ diff --git a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00006.png b/tests_zemu/snapshots/st-balances_force_transfer_rococo/00006.png deleted file mode 100644 index 07613ba3..00000000 Binary files a/tests_zemu/snapshots/st-balances_force_transfer_rococo/00006.png and /dev/null differ diff --git a/tests_zemu/snapshots/st-mainmenu/00000.png b/tests_zemu/snapshots/st-mainmenu/00000.png index 07613ba3..48feb3b8 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00000.png and b/tests_zemu/snapshots/st-mainmenu/00000.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00001.png b/tests_zemu/snapshots/st-mainmenu/00001.png index 85c5ccc3..36f95451 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00001.png and b/tests_zemu/snapshots/st-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00002.png b/tests_zemu/snapshots/st-mainmenu/00002.png index ed91b062..b6d6c05e 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00002.png and b/tests_zemu/snapshots/st-mainmenu/00002.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00003.png b/tests_zemu/snapshots/st-mainmenu/00003.png index 51ace922..36f95451 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00003.png and b/tests_zemu/snapshots/st-mainmenu/00003.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00004.png b/tests_zemu/snapshots/st-mainmenu/00004.png index ed91b062..ffeaf5e7 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00004.png and b/tests_zemu/snapshots/st-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00005.png b/tests_zemu/snapshots/st-mainmenu/00005.png index 07613ba3..7b07408e 100644 Binary files a/tests_zemu/snapshots/st-mainmenu/00005.png and b/tests_zemu/snapshots/st-mainmenu/00005.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00006.png b/tests_zemu/snapshots/st-mainmenu/00006.png new file mode 100644 index 00000000..48feb3b8 Binary files /dev/null and b/tests_zemu/snapshots/st-mainmenu/00006.png differ diff --git a/tests_zemu/snapshots/st-migration-mainmenu/00000.png b/tests_zemu/snapshots/st-migration-mainmenu/00000.png index 2b9fe30b..bf994897 100644 Binary files a/tests_zemu/snapshots/st-migration-mainmenu/00000.png and b/tests_zemu/snapshots/st-migration-mainmenu/00000.png differ diff --git a/tests_zemu/snapshots/st-migration-mainmenu/00001.png b/tests_zemu/snapshots/st-migration-mainmenu/00001.png index 03bcc21e..864430e4 100644 Binary files a/tests_zemu/snapshots/st-migration-mainmenu/00001.png and b/tests_zemu/snapshots/st-migration-mainmenu/00001.png differ diff --git a/tests_zemu/snapshots/st-migration-mainmenu/00002.png b/tests_zemu/snapshots/st-migration-mainmenu/00002.png index b68c80ce..d143b858 100644 Binary files a/tests_zemu/snapshots/st-migration-mainmenu/00002.png and b/tests_zemu/snapshots/st-migration-mainmenu/00002.png differ diff --git a/tests_zemu/snapshots/st-raw_sign/00000.png b/tests_zemu/snapshots/st-raw_sign/00000.png index a0814fb2..11ba32ca 100644 Binary files a/tests_zemu/snapshots/st-raw_sign/00000.png and b/tests_zemu/snapshots/st-raw_sign/00000.png differ diff --git a/tests_zemu/snapshots/st-raw_sign/00001.png b/tests_zemu/snapshots/st-raw_sign/00001.png index aaab39a5..bb1b791b 100644 Binary files a/tests_zemu/snapshots/st-raw_sign/00001.png and b/tests_zemu/snapshots/st-raw_sign/00001.png differ diff --git a/tests_zemu/snapshots/st-raw_sign/00002.png b/tests_zemu/snapshots/st-raw_sign/00002.png index a62786cd..a468c15b 100644 Binary files a/tests_zemu/snapshots/st-raw_sign/00002.png and b/tests_zemu/snapshots/st-raw_sign/00002.png differ diff --git a/tests_zemu/snapshots/st-raw_sign/00003.png b/tests_zemu/snapshots/st-raw_sign/00003.png index 07613ba3..48feb3b8 100644 Binary files a/tests_zemu/snapshots/st-raw_sign/00003.png and b/tests_zemu/snapshots/st-raw_sign/00003.png differ diff --git a/tests_zemu/snapshots/st-raw_sign_hex/00000.png b/tests_zemu/snapshots/st-raw_sign_hex/00000.png index a0814fb2..11ba32ca 100644 Binary files a/tests_zemu/snapshots/st-raw_sign_hex/00000.png and b/tests_zemu/snapshots/st-raw_sign_hex/00000.png differ diff --git a/tests_zemu/snapshots/st-raw_sign_hex/00001.png b/tests_zemu/snapshots/st-raw_sign_hex/00001.png index 2c3bc65c..d996a9b6 100644 Binary files a/tests_zemu/snapshots/st-raw_sign_hex/00001.png and b/tests_zemu/snapshots/st-raw_sign_hex/00001.png differ diff --git a/tests_zemu/snapshots/st-raw_sign_hex/00002.png b/tests_zemu/snapshots/st-raw_sign_hex/00002.png index 5fceeaf4..a468c15b 100644 Binary files a/tests_zemu/snapshots/st-raw_sign_hex/00002.png and b/tests_zemu/snapshots/st-raw_sign_hex/00002.png differ diff --git a/tests_zemu/snapshots/st-raw_sign_hex/00003.png b/tests_zemu/snapshots/st-raw_sign_hex/00003.png index a5a8c6d8..48feb3b8 100644 Binary files a/tests_zemu/snapshots/st-raw_sign_hex/00003.png and b/tests_zemu/snapshots/st-raw_sign_hex/00003.png differ diff --git a/tests_zemu/snapshots/st-show_address/00000.png b/tests_zemu/snapshots/st-show_address/00000.png index 28abda85..f11c9bd5 100644 Binary files a/tests_zemu/snapshots/st-show_address/00000.png and b/tests_zemu/snapshots/st-show_address/00000.png differ diff --git a/tests_zemu/snapshots/st-show_address/00001.png b/tests_zemu/snapshots/st-show_address/00001.png index b56b032d..e9855a8f 100644 Binary files a/tests_zemu/snapshots/st-show_address/00001.png and b/tests_zemu/snapshots/st-show_address/00001.png differ diff --git a/tests_zemu/snapshots/st-show_address/00002.png b/tests_zemu/snapshots/st-show_address/00002.png index e6d73d4a..9c28c542 100644 Binary files a/tests_zemu/snapshots/st-show_address/00002.png and b/tests_zemu/snapshots/st-show_address/00002.png differ diff --git a/tests_zemu/snapshots/st-show_address/00003.png b/tests_zemu/snapshots/st-show_address/00003.png index 07613ba3..48feb3b8 100644 Binary files a/tests_zemu/snapshots/st-show_address/00003.png and b/tests_zemu/snapshots/st-show_address/00003.png differ diff --git a/tests_zemu/snapshots/st-show_address_reject/00000.png b/tests_zemu/snapshots/st-show_address_reject/00000.png index 28abda85..f11c9bd5 100644 Binary files a/tests_zemu/snapshots/st-show_address_reject/00000.png and b/tests_zemu/snapshots/st-show_address_reject/00000.png differ diff --git a/tests_zemu/snapshots/st-show_address_reject/00001.png b/tests_zemu/snapshots/st-show_address_reject/00001.png index b56b032d..e9855a8f 100644 Binary files a/tests_zemu/snapshots/st-show_address_reject/00001.png and b/tests_zemu/snapshots/st-show_address_reject/00001.png differ diff --git a/tests_zemu/snapshots/st-show_address_reject/00002.png b/tests_zemu/snapshots/st-show_address_reject/00002.png index e6d73d4a..9c28c542 100644 Binary files a/tests_zemu/snapshots/st-show_address_reject/00002.png and b/tests_zemu/snapshots/st-show_address_reject/00002.png differ diff --git a/tests_zemu/snapshots/st-show_address_reject/00003.png b/tests_zemu/snapshots/st-show_address_reject/00003.png index 8c5f472e..94c91bb6 100644 Binary files a/tests_zemu/snapshots/st-show_address_reject/00003.png and b/tests_zemu/snapshots/st-show_address_reject/00003.png differ diff --git a/tests_zemu/snapshots/st-show_address_reject/00004.png b/tests_zemu/snapshots/st-show_address_reject/00004.png index 07613ba3..48feb3b8 100644 Binary files a/tests_zemu/snapshots/st-show_address_reject/00004.png and b/tests_zemu/snapshots/st-show_address_reject/00004.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00004.png b/tests_zemu/snapshots/x-mainmenu/00004.png index 84ef09ca..412f67a9 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00004.png and b/tests_zemu/snapshots/x-mainmenu/00004.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00010.png b/tests_zemu/snapshots/x-mainmenu/00010.png index 84ef09ca..412f67a9 100644 Binary files a/tests_zemu/snapshots/x-mainmenu/00010.png and b/tests_zemu/snapshots/x-mainmenu/00010.png differ diff --git a/tests_zemu/tests/common.ts b/tests_zemu/tests/common.ts index ef4c229b..661e8af7 100644 --- a/tests_zemu/tests/common.ts +++ b/tests_zemu/tests/common.ts @@ -7,17 +7,20 @@ const APP_PATH_S = resolve('../app/output/app_s.elf') const APP_PATH_X = resolve('../app/output/app_x.elf') const APP_PATH_SP = resolve('../app/output/app_s2.elf') const APP_PATH_ST = resolve('../app/output/app_stax.elf') +const APP_PATH_FL = resolve('../app/output/app_flex.elf') const MIG_PATH_S = resolve('../app/output/migration_s.elf') const MIG_PATH_X = resolve('../app/output/migration_x.elf') const MIG_PATH_SP = resolve('../app/output/migration_s2.elf') const MIG_PATH_ST = resolve('../app/output/migration_stax.elf') +const MIG_PATH_FL = resolve('../app/output/migration_flex.elf') export const models: IDeviceModel[] = [ { name: 'nanos', prefix: 'S', path: APP_PATH_S }, { name: 'nanox', prefix: 'X', path: APP_PATH_X }, { name: 'nanosp', prefix: 'SP', path: APP_PATH_SP }, { name: 'stax', prefix: 'ST', path: APP_PATH_ST }, + { name: 'flex', prefix: 'FL', path: APP_PATH_FL }, ] export const migrationModels: IDeviceModel[] = [ @@ -25,6 +28,7 @@ export const migrationModels: IDeviceModel[] = [ { name: 'nanox', prefix: 'X', path: MIG_PATH_X }, { name: 'nanosp', prefix: 'SP', path: MIG_PATH_SP }, { name: 'stax', prefix: 'ST', path: MIG_PATH_ST }, + { name: 'flex', prefix: 'FL', path: MIG_PATH_FL }, ] export const defaultOptions = { @@ -45,7 +49,7 @@ export const TEST_TRANSACTIONS = [ blob: '04020345b98de14f55fc5171cd60c8f20ab891520610529700bb6a460e6ffeefe01a240306dae85c2cfafaef7fbe1b429bd684ca7002e55e9fff354bdacc349069fbe09a33d7607f18f06fbc4afd3990496390a89df400031a20835133efde6e46ae100c27795afb90d9257c120121710f001a0000006408de7737c59c238890533af25896a2c20608d8b380bb01029acb392781063ee62d3e65bc11b648222e470666763d880c3025f5a4b267f0edb1c301a4a6f3d501', rootHash: 'b6648e3f302d557ff1ee5e6d2462f2c668b1c4ac92db6a05c6ab857372c10a13', metadata: - '60082873705f72756e74696d65384d756c74695369676e6174757265011c4564323535313904001651010148656432353531393a3a5369676e6174757265007d02082873705f72756e74696d65384d756c74695369676e6174757265011c5372323535313904001651010148737232353531393a3a5369676e6174757265047d02082873705f72756e74696d65384d756c74695369676e617475726501144563647361040016b901014065636473613a3a5369676e6174757265087d0204184f7074696f6e0110536f6d650400160400047d0510306672616d655f73797374656d28657874656e73696f6e733c636865636b5f6d6f7274616c69747938436865636b4d6f7274616c697479000400168505010c4572618105102873705f72756e74696d651c67656e657269630c6572610c45726101244d6f7274616c32343404000300d103850510306672616d655f73797374656d28657874656e73696f6e732c636865636b5f6e6f6e636528436865636b4e6f6e6365000400110120543a3a4e6f6e63658905086870616c6c65745f7472616e73616374696f6e5f7061796d656e74604368617267655472616e73616374696f6e5061796d656e7400040013013042616c616e63654f663c543e8d0508746672616d655f6d657461646174615f686173685f657874656e73696f6e44436865636b4d6574616461746148617368000401106d6f646516950501104d6f6465910508746672616d655f6d657461646174615f686173685f657874656e73696f6e104d6f6465011c456e61626c6564000495050c1c73705f636f72651863727970746f2c4163636f756e7449643332000400160401205b75383b2033325d000003200000000304083c7072696d69746976655f74797065731048323536000400160401205b75383b2033325d0c0002031000031400000003480838726f636f636f5f72756e74696d652c52756e74696d6543616c6c012042616c616e636573040016f801b50173656c663a3a73705f6170695f68696464656e5f696e636c756465735f636f6e7374727563745f72756e74696d653a3a68696464656e5f696e636c7564653a3a64697370617463680a3a3a43616c6c61626c6543616c6c466f723c42616c616e6365732c2052756e74696d653e10b40c2873705f72756e74696d65306d756c746961646472657373304d756c746941646472657373010849640400160001244163636f756e74496400f40c2873705f72756e74696d65306d756c746961646472657373304d756c7469416464726573730114496e64657804001501304163636f756e74496e64657804f40c2873705f72756e74696d65306d756c746961646472657373304d756c746941646472657373010c52617704001610011c5665633c75383e08f40c2873705f72756e74696d65306d756c746961646472657373304d756c74694164647265737301244164647265737333320400160401205b75383b2033325d0cf40c2873705f72756e74696d65306d756c746961646472657373304d756c74694164647265737301244164647265737332300400164801205b75383b2032305d10f40c3c70616c6c65745f62616c616e6365731870616c6c65741043616c6c0138666f7263655f7472616e736665720c0118736f7572636516f401504163636f756e7449644c6f6f6b75704f663c543e01106465737416f401504163636f756e7449644c6f6f6b75704f663c543e011476616c7565130128543a3a42616c616e636508f800034000000003510100034100000003b901604e0800004f080000500800007c0b00007d0b0000720c00007e0c00007f0c0000800c0000820c00004106000042060000440600004506000074060000e106000034070000350700003607000037070000380700003a07000061070000d2070000050140d0e3a60bc0081c3b128f4b59f4f36fce637964ac88a483f393bc347e2cf2c9174d252347d44fbc336e54f775a9e18c94d8c5507a1741847c63c84b07b86ffcd15d59e300e37db1df68c58e25ccb5844c1e99f92556e5350e43a895e8a68aee177048829573d3be7fc180e3d1fcf89c9d216c557a5b6bed233683beb09031b29150addfdb7871ab3b8fe1617989d79cadbfbf4a18395ff6e36a47f33e7d5ea6ccae4df8cef4f7821789308d933604783168eaee9227abcbb71291f021463ff8350620514c4ac1c507900658e0974ea6253d25bd68e47d182b76bde0ba5f382a5b11f96580db6ea22014eda642584eb0a4b0a6c7729e644090ebbca3d9e706b7bc570e356ff73a3d14b6b31b6d479203cca4160faec678752c979cdf4444b2a9be46fb78654a4e119b627f9f517abff7861a14c416dde066cbb68579b84703fe92571f619e44c3b353e28e5767a9a2482218d217aec38a7d61ab73d658b1903f373095fc9ed721398289614edcab0df4975a1c8988623627f2b32e20442f1bad0054ba3a771a8701fa371677c99b9c0f838860ebf95e570ca9aeb980bce22ed9b5e004e784bd9adfca689b8e040a7ea58f58e4cf11c911ff258406adc598eb92bf50fe9f3c9c6af53edeb65176e68f3bdcb342e1a12a1a1a17b399057f8aeace1232dbe32821bd170c9687d0fdb8637e2ec73ac4d686aa236354d3399f3891d0257bc89a651b38ff85a00d86b455e5d6f8340e39cd7c7203c6f64e0bd430c0c57402ccfc40453e184b40bc86238306bc7ef4ebfec645eba8150d145503ddf731d53cfe4773394253ec3028b90910f933fe0e2bc89c094c28f1feba529cc046a1eee431a357fd9d413486fcaac0b1dc1ad93e344c827dee672e7d625e8da68ced657ff32497496d9d8d2984ea17ca635f6bcd30a0a022b77812ad3cd9e9684fd2fb7ffb10abea99b90962543faf81f4a4edfba7170e40dbf4752d2c0a26b762d6c0ef4169f4c2f87f88e937043236b4e0eeafd1ba3edea005febfc2b3dad82d20083621590530e3c52d5d722d6baf1c47394b4ad2c3fc5e8cfaf04d0f6c9f6acb2cc53870d5332f1c449cfad163bc3bd32063b06dbdfaa500f9df287dd5ab72f3679e4f617da558c1e108d493dec3d939fce24293998629b4a6db2b8aee779558170f99725cd1d47353400e367226cbbacf496df57cb668a35ef49de2a0015a6792a1d308d14a716c2393950d511e81f494c45080dc60234dcb225cae83ad5362fc70eac3a7bf12ece613164b86c22092c338e2f46406981ef7e6e51117b3de0b167f5a3f4723d3f7b3ea9a91fdce7474f4c06b452187cbe6bcc979118064e3d7d3814e151905ab6499c76ccb290d3cc9fa2f41bd00139140b7206e31ff9d98e4beef1d1a2e20bbc4a225773b9327590503729e589420b1a75d86eaabff22d7ce5d76d4656a74fa3e343ab4eb80d4212ff1e2099a42a828e49fae58e998245b09f1762cc8cef24c9dad98cef6946d17995bd30d13874e2942aab84a3a47c6abb4a93386d54893394185dd13c4dc6301f5c4a992d5c9e7bee268f970a9baccbdba990ed7f6d6300d9551d6c94639e67c725763a6f9d002d22c64b512fc0d2d6c3deab95bc432f3d69dc8b760f5615e3551d8dce671aab940fc9710ca415c35b7ea5b8797a42a22e9b91367aff359a80f0a9ce7163f16bd16804ee1e77f499eb932b6642b0a3cdb36e79afda7284e33aa4d7ee5c22b919c407e9911bc7d17ebdf98016d3d76a0de1dd9ba084205e532a7bcc815b559fd4f6176666c1383cbb5321eed7abf6905e07565671fce9b24a10d582aae55bcbd5715b802bbaa91ba75bb014085307d54da73c265a6da53a9b1f8f2abdd321ba53c5b76fc831c34eac90b912d360ce60960387f23743ceb2cc61b2f629d18936d1a213e80ceb8584704e31e4be6a94cb0b91cd271e74ae4edccff7878087b36d6a63d4273b66409db46bff5902746c5166e2d0b620d0e9ec033617946353a49f661befa9d6ff18173e43e9c6a48cd29343c2e50f81049131ac4e9d75614c713d6ede92de7f08abaff159d39bb5db3cb79c6fac00043f1f80cafaf42804db540544692e2e69b1ad876bfc4e9209a56be52c56699e9faf9429758f3cf4b098d9b84a84730df91cb86c0e329da73f7d95ee4974fc3904962541c29c55a213c489b1142b89ef72c09e7a13d54d26a15a9791304aca23cd430582e763810732c60f347720ddafdc520e2131da0cd31d241620df34d8fdfcb6b9172e717ce95d9309b1901b3c1e9cf1e161665c5d17612f1074191beb6555447ab77d6621c6c860cb7301e724b7bce8293bfe7fddfc0464670ccf37116fb274f8393cbf36cfd9077be17661356f2ae8b8062d857000fb9ef0ce72b296004cb951440515066cbd5dcda894e7755cedc61dc0a2a7e2854929e8eeea77d6200f6575e9771d01933e1ab656c9b5c4bedd854a542017616a6fe9b8ef6a18a7db05ddf49c69c385da5a1b06575395d3eeb5c038ea7dcb554dc73a53d33593aa48ba429b1709f9c6fe90b901954f4bf7a353b41600f501a31ef1689cf320e884672ae2ad7e11f02f7aa4bd473876dbca1a855bb65755d0c7afacfe3947cb5963dc1a5ca1525c89d0b9e52b00286d2a971f6c3d87f97eb13ae4061804568b0873e96e4d989489363e1474cb3dac4239c764dc0788095558229be044883a7f0521b6a5255cdfb68f5e6417f96490ef06ba2a77cded47bbd9367c9f2758c92c42949fb632a6c39cf7f60f521940d5676e732b1df216515b235e6bab1f276134f07264cb2743b938cca1138c1ca7d2696ce3468f26238480bac732b67f1237425d479b7a4124e07a09629e2bc9c5f841bb54c8f22f30f52e7ff39061fb7780ea6d43e65db1c9451b6555069a9c3c9ba3639004dfb6e5a7f4cac8f0416f416b4167d022448436865636b4e6f6e5a65726f53656e646572151540436865636b5370656356657273696f6e150538436865636b547856657273696f6e150530436865636b47656e6573697315160c38436865636b4d6f7274616c697479168105160c28436865636b4e6f6e6365168905152c436865636b5765696768741515604368617267655472616e73616374696f6e5061796d656e74168d051544436865636b4d6574616461746148617368169105167d0521710f0018726f636f636f2a000c0c524f43', + '60082873705f72756e74696d65384d756c74695369676e6174757265011c4564323535313904001651010148656432353531393a3a5369676e6174757265007d02082873705f72756e74696d65384d756c74695369676e6174757265011c5372323535313904001651010148737232353531393a3a5369676e6174757265047d02082873705f72756e74696d65384d756c74695369676e617475726501144563647361040016b901014065636473613a3a5369676e6174757265087d0204184f7074696f6e0110536f6d650400160400047d0510306672616d655f73797374656d28657874656e73696f6e733c636865636b5f6d6f7274616c69747938436865636b4d6f7274616c697479000400168505010c4572618105102873705f72756e74696d651c67656e657269630c6572610c45726101244d6f7274616c32343404000300d103850510306672616d655f73797374656d28657874656e73696f6e732c636865636b5f6e6f6e636528436865636b4e6f6e6365000400110120543a3a4e6f6e63658905086870616c6c65745f7472616e73616374696f6e5f7061796d656e74604368617267655472616e73616374696f6e5061796d656e7400040013013042616c616e63654f663c543e8d0508746672616d655f6d657461646174615f686173685f657874656e73696f6e44436865636b4d6574616461746148617368000401106d6f646516950501104d6f6465910508746672616d655f6d657461646174615f686173685f657874656e73696f6e104d6f6465011c456e61626c6564000495050c1c73705f636f72651863727970746f2c4163636f756e7449643332000400160401205b75383b2033325d000003200000000304083c7072696d69746976655f74797065731048323536000400160401205b75383b2033325d0c0002031000031400000003480838726f636f636f5f72756e74696d652c52756e74696d6543616c6c012042616c616e636573040016f801b50173656c663a3a73705f6170695f68696464656e5f696e636c756465735f636f6e7374727563745f72756e74696d653a3a68696464656e5f696e636c7564653a3a64697370617463680a3a3a43616c6c61626c6543616c6c466f723c42616c616e6365732c2052756e74696d653e10b40c2873705f72756e74696d65306d756c746961646472657373304d756c746941646472657373010849640400160001244163636f756e74496400f40c2873705f72756e74696d65306d756c746961646472657373304d756c7469416464726573730114496e64657804001501304163636f756e74496e64657804f40c2873705f72756e74696d65306d756c746961646472657373304d756c746941646472657373010c52617704001610011c5665633c75383e08f40c2873705f72756e74696d65306d756c746961646472657373304d756c74694164647265737301244164647265737333320400160401205b75383b2033325d0cf40c2873705f72756e74696d65306d756c746961646472657373304d756c74694164647265737301244164647265737332300400164801205b75383b2032305d10f40c3c70616c6c65745f62616c616e6365731870616c6c65741043616c6c0138666f7263655f7472616e736665720c0118736f7572636516f401504163636f756e7449644c6f6f6b75704f663c543e01106465737416f401504163636f756e7449644c6f6f6b75704f663c543e011476616c7565130128543a3a42616c616e636508f800034000000003510100034100000003b901604e0800004f080000500800007c0b00007d0b0000720c00007e0c00007f0c0000800c0000820c00004106000042060000440600004506000074060000e106000034070000350700003607000037070000380700003a07000061070000d2070000050140d0e3a60bc0081c3b128f4b59f4f36fce637964ac88a483f393bc347e2cf2c9174d252347d44fbc336e54f775a9e18c94d8c5507a1741847c63c84b07b86ffcd15d59e300e37db1df68c58e25ccb5844c1e99f92556e5350e43a895e8a68aee177048829573d3be7fc180e3d1fcf89c9d216c557a5b6bed233683beb09031b29150addfdb7871ab3b8fe1617989d79cadbfbf4a18395ff6e36a47f33e7d5ea6ccae4df8cef4f7821789308d933604783168eaee9227abcbb71291f021463ff8350620514c4ac1c507900658e0974ea6253d25bd68e47d182b76bde0ba5f382a5b11f96580db6ea22014eda642584eb0a4b0a6c7729e644090ebbca3d9e706b7bc570e356ff73a3d14b6b31b6d479203cca4160faec678752c979cdf4444b2a9be46fb78654a4e119b627f9f517abff7861a14c416dde066cbb68579b84703fe92571f619e44c3b353e28e5767a9a2482218d217aec38a7d61ab73d658b1903f373095fc9ed721398289614edcab0df4975a1c8988623627f2b32e20442f1bad0054ba3a771a8701fa371677c99b9c0f838860ebf95e570ca9aeb980bce22ed9b5e004e784bd9adfca689b8e040a7ea58f58e4cf11c911ff258406adc598eb92bf50fe9f3c9c6af53edeb65176e68f3bdcb342e1a12a1a1a17b399057f8aeace1232dbe32821bd170c9687d0fdb8637e2ec73ac4d686aa236354d3399f3891d0257bc89a651b38ff85a00d86b455e5d6f8340e39cd7c7203c6f64e0bd430c0c57402ccfc40453e184b40bc86238306bc7ef4ebfec645eba8150d145503ddf731d53cfe4773394253ec3028b90910f933fe0e2bc89c094c28f1feba529cc046a1eee431a357fd9d413486fcaac0b1dc1ad93e344c827dee672e7d625e8da68ced657ff32497496d9d8d2984ea17ca635f6bcd30a0a022b77812ad3cd9e9684fd2fb7ffb10abea99b90962543faf81f4a4edfba7170e40dbf4752d2c0a26b762d6c0ef4169f4c2f87f88e937043236b4e0eeafd1ba3edea005febfc2b3dad82d20083621590530e3c52d5d722d6baf1c47394b4ad2c3fc5e8cfaf04d0f6c9f6acb2cc53870d5332f1c449cfad163bc3bd32063b06dbdfaa500f9df287dd5ab72f3679e4f617da558c1e108d493dec3d939fce24293998629b4a6db2b8aee779558170f99725cd1d47353400e367226cbbacf496df57cb668a35ef49de2a0015a6792a1d308d14a716c2393950d511e81f494c45080dc60234dcb225cae83ad5362fc70eac3a7bf12ece613164b86c22092c338e2f46406981ef7e6e51117b3de0b167f5a3f4723d3f7b3ea9a91fdce7474f4c06b452187cbe6bcc979118064e3d7d3814e151905ab6499c76ccb290d3cc9fa2f41bd00139140b7206e31ff9d98e4beef1d1a2e20bbc4a225773b9327590503729e589420b1a75d86eaabff22d7ce5d76d4656a74fa3e343ab4eb80d4212ff1e2099a42a828e49fae58e998245b09f1762cc8cef24c9dad98cef6946d17995bd30d13874e2942aab84a3a47c6abb4a93386d54893394185dd13c4dc6301f5c4a992d5c9e7bee268f970a9baccbdba990ed7f6d6300d9551d6c94639e67c725763a6f9d002d22c64b512fc0d2d6c3deab95bc432f3d69dc8b760f5615e3551d8dce671aab940fc9710ca415c35b7ea5b8797a42a22e9b91367aff359a80f0a9ce7163f16bd16804ee1e77f499eb932b6642b0a3cdb36e79afda7284e33aa4d7ee5c22b919c407e9911bc7d17ebdf98016d3d76a0de1dd9ba084205e532a7bcc815b559fd4f6176666c1383cbb5321eed7abf6905e07565671fce9b24a10d582aae55bcbd5715b802bbaa91ba75bb014085307d54da73c265a6da53a9b1f8f2abdd321ba53c5b76fc831c34eac90b912d360ce60960387f23743ceb2cc61b2f629d18936d1a213e80ceb8584704e31e4be6a94cb0b91cd271e74ae4edccff7878087b36d6a63d4273b66409db46bff5902746c5166e2d0b620d0e9ec033617946353a49f661befa9d6ff18173e43e9c6a48cd29343c2e50f81049131ac4e9d75614c713d6ede92de7f08abaff159d39bb5db3cb79c6fac00043f1f80cafaf42804db540544692e2e69b1ad876bfc4e9209a56be52c56699e9faf9429758f3cf4b098d9b84a84730df91cb86c0e329da73f7d95ee4974fc3904962541c29c55a213c489b1142b89ef72c09e7a13d54d26a15a9791304aca23cd430582e763810732c60f347720ddafdc520e2131da0cd31d241620df34d8fdfcb6b9172e717ce95d9309b1901b3c1e9cf1e161665c5d17612f1074191beb6555447ab77d6621c6c860cb7301e724b7bce8293bfe7fddfc0464670ccf37116fb274f8393cbf36cfd9077be17661356f2ae8b8062d857000fb9ef0ce72b296004cb951440515066cbd5dcda894e7755cedc61dc0a2a7e2854929e8eeea77d6200f6575e9771d01933e1ab656c9b5c4bedd854a542017616a6fe9b8ef6a18a7db05ddf49c69c385da5a1b06575395d3eeb5c038ea7dcb554dc73a53d33593aa48ba429b1709f9c6fe90b901954f4bf7a353b41600f501a31ef1689cf320e884672ae2ad7e11f02f7aa4bd473876dbca1a855bb65755d0c7afacfe3947cb5963dc1a5ca1525c89d0b9e52b00286d2a971f6c3d87f97eb13ae4061804568b0873e96e4d989489363e1474cb3dac4239c764dc0788095558229be044883a7f0521b6a5255cdfb68f5e6417f96490ef06ba2a77cded47bbd9367c9f2758c92c42949fb632a6c39cf7f60f521940d5676e732b1df216515b235e6bab1f276134f07264cb2743b938cca1138c1ca7d2696ce3468f26238480bac732b67f1237425d479b7a4124e07a09629e2bc9c5f841bb54c8f22f30f52e7ff39061fb7780ea6d43e65db1c9451b6555069a9c3c9ba3639004dfb6e5a7f4cac8f0416f416b4167d022448436865636b4e6f6e5a65726f53656e646572151540436865636b5370656356657273696f6e150538436865636b547856657273696f6e150530436865636b47656e6573697315160c38436865636b4d6f7274616c697479168105160c28436865636b4e6f6e6365168905152c436865636b5765696768741515604368617267655472616e73616374696f6e5061796d656e74168d051544436865636b4d6574616461746148617368169105167d0521710f0018726f636f636f2a000c0c524f43', }, ] diff --git a/tests_zemu/tests/migration.test.ts b/tests_zemu/tests/migration.test.ts index 23c4edcd..ba4ec3ab 100644 --- a/tests_zemu/tests/migration.test.ts +++ b/tests_zemu/tests/migration.test.ts @@ -14,11 +14,11 @@ * limitations under the License. ******************************************************************************/ -import Zemu, { ButtonKind, ClickNavigation, TouchNavigation } from '@zondax/zemu' +import Zemu, { ButtonKind, ClickNavigation, TouchNavigation, isTouchDevice } from '@zondax/zemu' import { ASTAR_PATH, defaultOptions, DOT_SS58_PREFIX, migrationModels, PATH } from './common' import { PolkadotGenericApp } from '@zondax/ledger-substrate' -import { IButton } from '@zondax/zemu/dist/types' +import { IButton, SwipeDirection } from '@zondax/zemu/dist/types' const polkadot_pk = 'e1b4d72d27b3e91b9b6116555b4ea17138ddc12ca7cdbab30e2e0509bd848419' const astar_pk = 'cf557b2d2bebf3e14f932fec31d2b3ea776b63eede6658e282c9ab3f27d1287b' @@ -29,44 +29,41 @@ describe('Migration', function () { test.concurrent.each(migrationModels)('main menu + get version', async function (m) { const sim = new Zemu(m.path) try { - let migrationStartText = '' - switch (m.name) { - case 'nanos': - migrationStartText = 'Migration' - break; - - case 'nanosp': - case 'nanox': - migrationStartText = 'Please' - break; - - case 'stax': - migrationStartText = 'Review' - break; + let migrationStartText = 'review' + if (m.name === 'nanos') { + migrationStartText = 'Migration' } await sim.start({ ...defaultOptions, startText: migrationStartText, model: m.name, - approveKeyword: m.name === 'stax' ? 'frequently' : '', - approveAction: ButtonKind.ApproveTapButton, + approveKeyword: isTouchDevice(m.name) ? 'Accept' : '', + approveAction: ButtonKind.DynamicTapButton, }) let nav = undefined; - if (m.name === 'stax') { + if (isTouchDevice(m.name)) { const okButton: IButton = { x: 200, y: 550, delay: 0.25, + direction: SwipeDirection.NoSwipe, }; - nav = new TouchNavigation([ - ButtonKind.TapContinueButton, + nav = new TouchNavigation(m.name, [ + ButtonKind.SwipeContinueButton, ButtonKind.ConfirmYesButton, ]); nav.schedule[1].button = okButton; } else { nav = new ClickNavigation([4, 0]); } - await sim.navigate('.', `${m.prefix.toLowerCase()}-migration-mainmenu`, nav.schedule); + + const path = '.' + const testcaseName = `${m.prefix.toLowerCase()}-migration-mainmenu` + + const lastIndex = await sim.navigate(path, testcaseName, nav.schedule); + await sim.compareSnapshots(path, testcaseName, lastIndex) + await sim.takeSnapshotAndOverwrite(path, testcaseName, lastIndex); + const app = new PolkadotGenericApp(sim.getTransport(), 'dot') // Verify app version diff --git a/tests_zemu/tests/raw.test.ts b/tests_zemu/tests/raw.test.ts index 1c697d58..fd75d434 100644 --- a/tests_zemu/tests/raw.test.ts +++ b/tests_zemu/tests/raw.test.ts @@ -21,7 +21,7 @@ import { defaultOptions, DOT_SS58_PREFIX, PATH, models } from './common' import ed25519 from 'ed25519-supercop' import { blake2bFinal, blake2bInit, blake2bUpdate } from 'blakejs' import { PolkadotGenericApp } from '@zondax/ledger-substrate' -import {ResponseError} from "@zondax/ledger-js"; +import { ResponseError } from "@zondax/ledger-js"; jest.setTimeout(180000) @@ -72,7 +72,7 @@ describe.each(TESTS)('Raw signing', function (data) { }) }) -test.concurrent.each(models)('raw signing - incorrect', async function (m) { +test.concurrent.each(models)('Raw signing - incorrect', async function (m) { const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) @@ -80,7 +80,7 @@ test.concurrent.each(models)('raw signing - incorrect', async function (m) { const txBlob = Buffer.from('Incorrect blob/Bytes>') - let errorFound:any = undefined + let errorFound: any = undefined try { await app.signRaw(PATH, txBlob) } catch (error) { @@ -88,15 +88,15 @@ test.concurrent.each(models)('raw signing - incorrect', async function (m) { } console.log(errorFound) - + expect(errorFound).toBeDefined() expect('returnCode' in errorFound).toBeTruthy() expect('errorMessage' in errorFound).toBeTruthy() - if('returnCode' in errorFound){ + if ('returnCode' in errorFound) { expect(errorFound.returnCode).toBe(27012) } - if('errorMessage' in errorFound){ + if ('errorMessage' in errorFound) { expect(errorFound.errorMessage).toBe("Data is invalid : Unexpected value") } diff --git a/tests_zemu/tests/standard.test.ts b/tests_zemu/tests/standard.test.ts index 6bd92771..f13fa450 100644 --- a/tests_zemu/tests/standard.test.ts +++ b/tests_zemu/tests/standard.test.ts @@ -14,7 +14,7 @@ * limitations under the License. ******************************************************************************* */ -import Zemu, { ButtonKind, zondaxMainmenuNavigation } from '@zondax/zemu' +import Zemu, { ButtonKind, zondaxMainmenuNavigation, isTouchDevice } from '@zondax/zemu' import { defaultOptions, DOT_SS58_PREFIX, PATH, models } from './common' import { PolkadotGenericApp } from '@zondax/ledger-substrate' @@ -85,11 +85,10 @@ describe('Standard', function () { await sim.start({ ...defaultOptions, model: m.name, - approveKeyword: m.name === 'stax' ? 'Public key' : '', - approveAction: ButtonKind.ApproveTapButton, + approveKeyword: isTouchDevice(m.name) ? 'Confirm' : '', + approveAction: ButtonKind.DynamicTapButton, }) const app = new PolkadotGenericApp(sim.getTransport(), 'dot', '') - const respRequest = app.getAddress(PATH, DOT_SS58_PREFIX, true) // Wait until we are not in the main menu await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot()) @@ -112,7 +111,7 @@ describe('Standard', function () { await sim.start({ ...defaultOptions, model: m.name, - rejectKeyword: m.name === 'stax' ? 'Public key' : '', + rejectKeyword: isTouchDevice(m.name) ? 'Public key' : '', }) const app = new PolkadotGenericApp(sim.getTransport(), 'dot') diff --git a/tests_zemu/tests/transactions.test.ts b/tests_zemu/tests/transactions.test.ts index 62cb4dc9..580163cb 100644 --- a/tests_zemu/tests/transactions.test.ts +++ b/tests_zemu/tests/transactions.test.ts @@ -26,7 +26,7 @@ import { blake2bFinal, blake2bInit, blake2bUpdate } from 'blakejs' jest.setTimeout(180000) describe.each(TEST_TRANSACTIONS)('Transactions - OK', function (data) { - test.each(models)(`Test: ${data.name}`, async function (m) { + test.concurrent.each(models)(`Test: ${data.name}`, async function (m) { const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) @@ -63,13 +63,13 @@ describe.each(TEST_TRANSACTIONS)('Transactions - OK', function (data) { }) describe.each(TEST_TRANSACTIONS)('Transactions - API - OK', function (data) { - test.each(models)(`Test: ${data.name}`, async function (m) { + test.concurrent.each(models)(`Test: ${data.name}`, async function (m) { const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name }) const app = new PolkadotGenericApp(sim.getTransport(), 'roc', 'https://api.zondax.ch/polkadot/transaction/metadata') - const resp = await axios.post("https://api.zondax.ch/polkadot/node/metadata/hash", {id: 'roc'}) + const resp = await axios.post("https://api.zondax.ch/polkadot/node/metadata/hash", { id: 'roc' }) const blob = Buffer.from(data.blob.replace("", resp.data.metadataHash), 'hex') const { pubKey } = await app.getAddress(PATH, DOT_SS58_PREFIX) @@ -100,7 +100,7 @@ describe.each(TEST_TRANSACTIONS)('Transactions - API - OK', function (data) { }) describe.each(TEST_TRANSACTIONS_FAIL)('Transactions - FAIL', function (data) { - test.each(models)(`Test: ${data.name} - ${data.description}`, async function (m) { + test.concurrent.each(models)(`Test: ${data.name} - ${data.description}`, async function (m) { const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name })