diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0b240304..c9fd3208 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,7 +13,7 @@ jobs: name: Analyse strategy: matrix: - sdk: ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK"] + sdk: ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK"] runs-on: ubuntu-latest container: image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest diff --git a/.github/workflows/guidelines_enforcer.yml b/.github/workflows/guidelines_enforcer.yml index b39250cb..e2dae281 100644 --- a/.github/workflows/guidelines_enforcer.yml +++ b/.github/workflows/guidelines_enforcer.yml @@ -23,4 +23,3 @@ jobs: uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1 with: relative_app_directory: app - run_for_devices: '["nanos", "nanosp", "nanox"]' diff --git a/Makefile b/Makefile index c6991071..eb480bcb 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ ifeq ($(BOLOS_SDK),) # In this case, there is not predefined SDK and we run dockerized # When not using the SDK, we override and build the XL complete app +ZXLIB_COMPILE_STAX ?= 1 SUBSTRATE_PARSER_FULL ?= 1 include $(CURDIR)/deps/ledger-zxlib/dockerized_build.mk @@ -47,6 +48,5 @@ zemu_install: tests_tools_build test_all: make zemu_install SUBSTRATE_PARSER_FULL=1 make - make clean_glyphs SUBSTRATE_PARSER_FULL=1 SUPPORT_SR25519=1 make buildS make zemu_test diff --git a/app/Makefile.version b/app/Makefile.version index bca4fcaa..323acee5 100644 --- a/app/Makefile.version +++ b/app/Makefile.version @@ -3,4 +3,4 @@ APPVERSION_M=22 # This is the `spec_version` field of `Runtime` APPVERSION_N=9420 # This is the patch version of this release -APPVERSION_P=0 +APPVERSION_P=1 diff --git a/app/glyphs/icon_stax_32.gif b/app/glyphs/icon_stax_32.gif new file mode 100644 index 00000000..d2c7ea85 Binary files /dev/null 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 new file mode 100644 index 00000000..96096909 Binary files /dev/null and b/app/glyphs/icon_stax_64.gif differ diff --git a/app/src/common/tx.c b/app/src/common/tx.c index 7a979b98..992558b1 100644 --- a/app/src/common/tx.c +++ b/app/src/common/tx.c @@ -21,7 +21,7 @@ #include #include "zxmacros.h" -#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) +#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) #define RAM_BUFFER_SIZE 8192 #define FLASH_BUFFER_SIZE 16384 #elif defined(TARGET_NANOS) @@ -37,7 +37,7 @@ typedef struct { uint8_t buffer[FLASH_BUFFER_SIZE]; } storage_t; -#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) +#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) 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 64b30d15..a548ba14 100644 --- a/app/src/crypto_helper.c +++ b/app/src/crypto_helper.c @@ -17,7 +17,7 @@ #include "crypto_helper.h" #include "base58.h" -#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) +#if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) #include "cx.h" int ss58hash(const unsigned char *in, unsigned int inLen, diff --git a/app/src/parser_txdef.h b/app/src/parser_txdef.h index 051e6302..a66f54bd 100644 --- a/app/src/parser_txdef.h +++ b/app/src/parser_txdef.h @@ -23,7 +23,7 @@ extern "C" { #include #include "substrate_methods.h" -#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) +#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) #define MAX_CALL_NESTING_SIZE 6 #define MAX_CALL_VEC_SIZE 6 #else diff --git a/app/src/substrate/substrate_types.c b/app/src/substrate/substrate_types.c index 81959391..76ba04fc 100644 --- a/app/src/substrate/substrate_types.c +++ b/app/src/substrate/substrate_types.c @@ -1334,6 +1334,7 @@ parser_error_t _readMetadataOwner(parser_context_t* c, pd_MetadataOwner_t* v) parser_error_t _readOptionMultiSigner(parser_context_t* c, pd_OptionMultiSigner_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readMultiSigner(c, &v->verifier)) @@ -1583,6 +1584,7 @@ parser_error_t _readVecu8(parser_context_t* c, pd_Vecu8_t* v) { parser_error_t _readOptionNetworkIdV3(parser_context_t* c, pd_OptionNetworkIdV3_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readNetworkIdV3(c, &v->contained)) @@ -1592,6 +1594,7 @@ parser_error_t _readOptionNetworkIdV3(parser_context_t* c, pd_OptionNetworkIdV3_ parser_error_t _readOptionu8_array_20(parser_context_t* c, pd_Optionu8_array_20_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readu8_array_20(c, &v->contained)) @@ -1601,6 +1604,7 @@ parser_error_t _readOptionu8_array_20(parser_context_t* c, pd_Optionu8_array_20_ parser_error_t _readOptionMultiSignature(parser_context_t* c, pd_OptionMultiSignature_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readMultiSignature(c, &v->contained)) @@ -1610,6 +1614,7 @@ parser_error_t _readOptionMultiSignature(parser_context_t* c, pd_OptionMultiSign parser_error_t _readOptionTimepoint(parser_context_t* c, pd_OptionTimepoint_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readTimepoint(c, &v->contained)) @@ -1619,6 +1624,7 @@ parser_error_t _readOptionTimepoint(parser_context_t* c, pd_OptionTimepoint_t* v parser_error_t _readOptionTuplePerbillAccountId(parser_context_t* c, pd_OptionTuplePerbillAccountId_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readTuplePerbillAccountId(c, &v->contained)) @@ -1628,6 +1634,7 @@ parser_error_t _readOptionTuplePerbillAccountId(parser_context_t* c, pd_OptionTu parser_error_t _readOptionAccountId(parser_context_t* c, pd_OptionAccountId_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readAccountId(c, &v->contained)) @@ -1637,6 +1644,7 @@ parser_error_t _readOptionAccountId(parser_context_t* c, pd_OptionAccountId_t* v parser_error_t _readOptionClassOf(parser_context_t* c, pd_OptionClassOf_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readClassOf(c, &v->contained)) @@ -1646,6 +1654,7 @@ parser_error_t _readOptionClassOf(parser_context_t* c, pd_OptionClassOf_t* v) parser_error_t _readOptionPerquintill(parser_context_t* c, pd_OptionPerquintill_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readPerquintill(c, &v->contained)) @@ -1655,6 +1664,7 @@ parser_error_t _readOptionPerquintill(parser_context_t* c, pd_OptionPerquintill_ parser_error_t _readOptionPreimageHash(parser_context_t* c, pd_OptionPreimageHash_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readPreimageHash(c, &v->contained)) @@ -1664,6 +1674,7 @@ parser_error_t _readOptionPreimageHash(parser_context_t* c, pd_OptionPreimageHas parser_error_t _readOptionProxyType(parser_context_t* c, pd_OptionProxyType_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readProxyType(c, &v->contained)) @@ -1673,6 +1684,7 @@ parser_error_t _readOptionProxyType(parser_context_t* c, pd_OptionProxyType_t* v parser_error_t _readOptionReferendumIndex(parser_context_t* c, pd_OptionReferendumIndex_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readReferendumIndex(c, &v->contained)) @@ -1682,6 +1694,7 @@ parser_error_t _readOptionReferendumIndex(parser_context_t* c, pd_OptionReferend parser_error_t _readOptionu32(parser_context_t* c, pd_Optionu32_t* v) { + CHECK_INPUT() CHECK_ERROR(_readUInt8(c, &v->some)) if (v->some > 0) { CHECK_ERROR(_readu32(c, &v->contained)) diff --git a/app/stax_icon.gif b/app/stax_icon.gif new file mode 100644 index 00000000..d2c7ea85 Binary files /dev/null and b/app/stax_icon.gif differ diff --git a/deps/ledger-zxlib b/deps/ledger-zxlib index cb80e302..8436f286 160000 --- a/deps/ledger-zxlib +++ b/deps/ledger-zxlib @@ -1 +1 @@ -Subproject commit cb80e3020475b14a29338e964c55d82eae048df6 +Subproject commit 8436f2869835a38bb7a08e8c732d3cdbe3114c6a diff --git a/deps/nanos-secure-sdk b/deps/nanos-secure-sdk index 8b6fdc43..8663123a 160000 --- a/deps/nanos-secure-sdk +++ b/deps/nanos-secure-sdk @@ -1 +1 @@ -Subproject commit 8b6fdc43b89ade975a032ddbe710ad872894956f +Subproject commit 8663123a243894bb1652685e44a787f7df1b9447 diff --git a/deps/nanosplus-secure-sdk b/deps/nanosplus-secure-sdk index 9a051d39..4d83d579 160000 --- a/deps/nanosplus-secure-sdk +++ b/deps/nanosplus-secure-sdk @@ -1 +1 @@ -Subproject commit 9a051d39953fd2406b4910abc160942dee2be320 +Subproject commit 4d83d57997b60567da495decec673735d9511a9e diff --git a/deps/nanox-secure-sdk b/deps/nanox-secure-sdk index 9a051d39..4d83d579 160000 --- a/deps/nanox-secure-sdk +++ b/deps/nanox-secure-sdk @@ -1 +1 @@ -Subproject commit 9a051d39953fd2406b4910abc160942dee2be320 +Subproject commit 4d83d57997b60567da495decec673735d9511a9e diff --git a/tests_zemu/package.json b/tests_zemu/package.json index 3a16ac43..5945fa9e 100644 --- a/tests_zemu/package.json +++ b/tests_zemu/package.json @@ -15,11 +15,11 @@ ], "scripts": { "clean": "ts-node tests/pullImageKillOld.ts", - "test": "yarn clean && jest" + "test": "yarn clean && jest --maxConcurrency 2" }, "dependencies": { "@zondax/ledger-substrate": "^0.40.5", - "@zondax/zemu": "^0.42.0" + "@zondax/zemu": "^0.42.1" }, "devDependencies": { "@types/jest": "^29.2.1", diff --git a/tests_zemu/snapshots/s-mainmenu/00004.png b/tests_zemu/snapshots/s-mainmenu/00004.png index 32d66839..242d8378 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 32d66839..242d8378 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 7ee8dfc0..31c70ca6 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 7ee8dfc0..31c70ca6 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_transfer/00000.png b/tests_zemu/snapshots/st-balances_transfer/00000.png new file mode 100644 index 00000000..e14ba70d Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer/00000.png differ diff --git a/tests_zemu/snapshots/st-balances_transfer/00001.png b/tests_zemu/snapshots/st-balances_transfer/00001.png new file mode 100644 index 00000000..d1c263db Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer/00001.png differ diff --git a/tests_zemu/snapshots/st-balances_transfer/00002.png b/tests_zemu/snapshots/st-balances_transfer/00002.png new file mode 100644 index 00000000..91f9244d Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer/00002.png differ diff --git a/tests_zemu/snapshots/st-balances_transfer/00003.png b/tests_zemu/snapshots/st-balances_transfer/00003.png new file mode 100644 index 00000000..55af1a36 Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer/00003.png differ diff --git a/tests_zemu/snapshots/st-balances_transfer/00004.png b/tests_zemu/snapshots/st-balances_transfer/00004.png new file mode 100644 index 00000000..c180cd5d Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer/00004.png differ diff --git a/tests_zemu/snapshots/st-balances_transfer_expert/00000.png b/tests_zemu/snapshots/st-balances_transfer_expert/00000.png new file mode 100644 index 00000000..e14ba70d Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer_expert/00000.png differ diff --git a/tests_zemu/snapshots/st-balances_transfer_expert/00001.png b/tests_zemu/snapshots/st-balances_transfer_expert/00001.png new file mode 100644 index 00000000..277a3670 Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer_expert/00001.png differ diff --git a/tests_zemu/snapshots/st-balances_transfer_expert/00002.png b/tests_zemu/snapshots/st-balances_transfer_expert/00002.png new file mode 100644 index 00000000..a90092cb Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer_expert/00002.png differ diff --git a/tests_zemu/snapshots/st-balances_transfer_expert/00003.png b/tests_zemu/snapshots/st-balances_transfer_expert/00003.png new file mode 100644 index 00000000..a00cafbd Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer_expert/00003.png differ diff --git a/tests_zemu/snapshots/st-balances_transfer_expert/00004.png b/tests_zemu/snapshots/st-balances_transfer_expert/00004.png new file mode 100644 index 00000000..290ce2d0 Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer_expert/00004.png differ diff --git a/tests_zemu/snapshots/st-balances_transfer_expert/00005.png b/tests_zemu/snapshots/st-balances_transfer_expert/00005.png new file mode 100644 index 00000000..552b18b8 Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer_expert/00005.png differ diff --git a/tests_zemu/snapshots/st-balances_transfer_expert/00006.png b/tests_zemu/snapshots/st-balances_transfer_expert/00006.png new file mode 100644 index 00000000..c180cd5d Binary files /dev/null and b/tests_zemu/snapshots/st-balances_transfer_expert/00006.png differ diff --git a/tests_zemu/snapshots/st-mainmenu/00000.png b/tests_zemu/snapshots/st-mainmenu/00000.png new file mode 100644 index 00000000..c180cd5d Binary files /dev/null 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 new file mode 100644 index 00000000..f72f3e76 Binary files /dev/null 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 new file mode 100644 index 00000000..dbab7cc2 Binary files /dev/null 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 new file mode 100644 index 00000000..b9045fd4 Binary files /dev/null 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 new file mode 100644 index 00000000..dbab7cc2 Binary files /dev/null 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 new file mode 100644 index 00000000..c180cd5d Binary files /dev/null and b/tests_zemu/snapshots/st-mainmenu/00005.png differ diff --git a/tests_zemu/snapshots/st-proxy_proxy/00000.png b/tests_zemu/snapshots/st-proxy_proxy/00000.png new file mode 100644 index 00000000..e14ba70d Binary files /dev/null and b/tests_zemu/snapshots/st-proxy_proxy/00000.png differ diff --git a/tests_zemu/snapshots/st-proxy_proxy/00001.png b/tests_zemu/snapshots/st-proxy_proxy/00001.png new file mode 100644 index 00000000..764ffcbb Binary files /dev/null and b/tests_zemu/snapshots/st-proxy_proxy/00001.png differ diff --git a/tests_zemu/snapshots/st-proxy_proxy/00002.png b/tests_zemu/snapshots/st-proxy_proxy/00002.png new file mode 100644 index 00000000..82dc7540 Binary files /dev/null and b/tests_zemu/snapshots/st-proxy_proxy/00002.png differ diff --git a/tests_zemu/snapshots/st-proxy_proxy/00003.png b/tests_zemu/snapshots/st-proxy_proxy/00003.png new file mode 100644 index 00000000..f6b206e5 Binary files /dev/null and b/tests_zemu/snapshots/st-proxy_proxy/00003.png differ diff --git a/tests_zemu/snapshots/st-proxy_proxy/00004.png b/tests_zemu/snapshots/st-proxy_proxy/00004.png new file mode 100644 index 00000000..42ffb47a Binary files /dev/null and b/tests_zemu/snapshots/st-proxy_proxy/00004.png differ diff --git a/tests_zemu/snapshots/st-proxy_proxy/00005.png b/tests_zemu/snapshots/st-proxy_proxy/00005.png new file mode 100644 index 00000000..c180cd5d Binary files /dev/null and b/tests_zemu/snapshots/st-proxy_proxy/00005.png differ diff --git a/tests_zemu/snapshots/st-session_setkeys/00000.png b/tests_zemu/snapshots/st-session_setkeys/00000.png new file mode 100644 index 00000000..e14ba70d Binary files /dev/null and b/tests_zemu/snapshots/st-session_setkeys/00000.png differ diff --git a/tests_zemu/snapshots/st-session_setkeys/00001.png b/tests_zemu/snapshots/st-session_setkeys/00001.png new file mode 100644 index 00000000..1d5552ca Binary files /dev/null and b/tests_zemu/snapshots/st-session_setkeys/00001.png differ diff --git a/tests_zemu/snapshots/st-session_setkeys/00002.png b/tests_zemu/snapshots/st-session_setkeys/00002.png new file mode 100644 index 00000000..8623cf17 Binary files /dev/null and b/tests_zemu/snapshots/st-session_setkeys/00002.png differ diff --git a/tests_zemu/snapshots/st-session_setkeys/00003.png b/tests_zemu/snapshots/st-session_setkeys/00003.png new file mode 100644 index 00000000..7ef426d7 Binary files /dev/null and b/tests_zemu/snapshots/st-session_setkeys/00003.png differ diff --git a/tests_zemu/snapshots/st-session_setkeys/00004.png b/tests_zemu/snapshots/st-session_setkeys/00004.png new file mode 100644 index 00000000..589403dd Binary files /dev/null and b/tests_zemu/snapshots/st-session_setkeys/00004.png differ diff --git a/tests_zemu/snapshots/st-session_setkeys/00005.png b/tests_zemu/snapshots/st-session_setkeys/00005.png new file mode 100644 index 00000000..552b18b8 Binary files /dev/null and b/tests_zemu/snapshots/st-session_setkeys/00005.png differ diff --git a/tests_zemu/snapshots/st-session_setkeys/00006.png b/tests_zemu/snapshots/st-session_setkeys/00006.png new file mode 100644 index 00000000..c180cd5d Binary files /dev/null and b/tests_zemu/snapshots/st-session_setkeys/00006.png differ diff --git a/tests_zemu/snapshots/st-show_address/00000.png b/tests_zemu/snapshots/st-show_address/00000.png new file mode 100644 index 00000000..5f65810e Binary files /dev/null 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 new file mode 100644 index 00000000..59d8df8a Binary files /dev/null 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 new file mode 100644 index 00000000..c180cd5d Binary files /dev/null and b/tests_zemu/snapshots/st-show_address/00002.png differ diff --git a/tests_zemu/snapshots/st-show_address_reject/00000.png b/tests_zemu/snapshots/st-show_address_reject/00000.png new file mode 100644 index 00000000..5f65810e Binary files /dev/null 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 new file mode 100644 index 00000000..59d8df8a Binary files /dev/null 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 new file mode 100644 index 00000000..58edec41 Binary files /dev/null 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 new file mode 100644 index 00000000..c180cd5d Binary files /dev/null and b/tests_zemu/snapshots/st-show_address_reject/00003.png differ diff --git a/tests_zemu/snapshots/st-staking_nominate/00000.png b/tests_zemu/snapshots/st-staking_nominate/00000.png new file mode 100644 index 00000000..e14ba70d Binary files /dev/null and b/tests_zemu/snapshots/st-staking_nominate/00000.png differ diff --git a/tests_zemu/snapshots/st-staking_nominate/00001.png b/tests_zemu/snapshots/st-staking_nominate/00001.png new file mode 100644 index 00000000..90cb90f4 Binary files /dev/null and b/tests_zemu/snapshots/st-staking_nominate/00001.png differ diff --git a/tests_zemu/snapshots/st-staking_nominate/00002.png b/tests_zemu/snapshots/st-staking_nominate/00002.png new file mode 100644 index 00000000..62ec4ef3 Binary files /dev/null and b/tests_zemu/snapshots/st-staking_nominate/00002.png differ diff --git a/tests_zemu/snapshots/st-staking_nominate/00003.png b/tests_zemu/snapshots/st-staking_nominate/00003.png new file mode 100644 index 00000000..16e5769b Binary files /dev/null and b/tests_zemu/snapshots/st-staking_nominate/00003.png differ diff --git a/tests_zemu/snapshots/st-staking_nominate/00004.png b/tests_zemu/snapshots/st-staking_nominate/00004.png new file mode 100644 index 00000000..42ffb47a Binary files /dev/null and b/tests_zemu/snapshots/st-staking_nominate/00004.png differ diff --git a/tests_zemu/snapshots/st-staking_nominate/00005.png b/tests_zemu/snapshots/st-staking_nominate/00005.png new file mode 100644 index 00000000..c180cd5d Binary files /dev/null and b/tests_zemu/snapshots/st-staking_nominate/00005.png differ diff --git a/tests_zemu/snapshots/st-txUtility_batch/00000.png b/tests_zemu/snapshots/st-txUtility_batch/00000.png new file mode 100644 index 00000000..e14ba70d Binary files /dev/null and b/tests_zemu/snapshots/st-txUtility_batch/00000.png differ diff --git a/tests_zemu/snapshots/st-txUtility_batch/00001.png b/tests_zemu/snapshots/st-txUtility_batch/00001.png new file mode 100644 index 00000000..483490a3 Binary files /dev/null and b/tests_zemu/snapshots/st-txUtility_batch/00001.png differ diff --git a/tests_zemu/snapshots/st-txUtility_batch/00002.png b/tests_zemu/snapshots/st-txUtility_batch/00002.png new file mode 100644 index 00000000..6b2084ea Binary files /dev/null and b/tests_zemu/snapshots/st-txUtility_batch/00002.png differ diff --git a/tests_zemu/snapshots/st-txUtility_batch/00003.png b/tests_zemu/snapshots/st-txUtility_batch/00003.png new file mode 100644 index 00000000..55af1a36 Binary files /dev/null and b/tests_zemu/snapshots/st-txUtility_batch/00003.png differ diff --git a/tests_zemu/snapshots/st-txUtility_batch/00004.png b/tests_zemu/snapshots/st-txUtility_batch/00004.png new file mode 100644 index 00000000..c180cd5d Binary files /dev/null and b/tests_zemu/snapshots/st-txUtility_batch/00004.png differ diff --git a/tests_zemu/snapshots/x-mainmenu/00004.png b/tests_zemu/snapshots/x-mainmenu/00004.png index 7ee8dfc0..31c70ca6 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 7ee8dfc0..31c70ca6 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 ea588f15..123a0093 100644 --- a/tests_zemu/tests/common.ts +++ b/tests_zemu/tests/common.ts @@ -7,9 +7,11 @@ export const APP_SEED = 'equip will roof matter pink blind book anxiety banner e 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') 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 }, ] diff --git a/tests_zemu/tests/standard.test.ts b/tests_zemu/tests/standard.test.ts index d3a6d999..e7002780 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, { DEFAULT_START_OPTIONS, zondaxMainmenuNavigation } from '@zondax/zemu' +import Zemu, { ButtonKind, DEFAULT_START_OPTIONS, zondaxMainmenuNavigation } from '@zondax/zemu' import { newKusamaApp } from '@zondax/ledger-substrate' import { APP_SEED, models } from './common' @@ -94,7 +94,12 @@ describe('Standard', function () { test.concurrent.each(models)('show address', async function (m) { const sim = new Zemu(m.path) try { - await sim.start({ ...defaultOptions, model: m.name }) + await sim.start({ + ...defaultOptions, + model: m.name, + approveKeyword: m.name === 'stax' ? 'QR' : '', + approveAction: ButtonKind.ApproveTapButton, + }) const app = newKusamaApp(sim.getTransport()) const respRequest = app.getAddress(0x80000000, 0x80000000, 0x80000000, true) @@ -119,7 +124,11 @@ describe('Standard', function () { test.concurrent.each(models)('show address - reject', async function (m) { const sim = new Zemu(m.path) try { - await sim.start({ ...defaultOptions, model: m.name }) + await sim.start({ + ...defaultOptions, + model: m.name, + rejectKeyword: m.name === 'stax' ? 'QR' : '', + }) const app = newKusamaApp(sim.getTransport()) const respRequest = app.getAddress(0x80000000, 0x80000000, 0x80000000, true)