From 30fd91e37fdfd205eaa6391f2f1d9632841957ac Mon Sep 17 00:00:00 2001 From: abenso Date: Mon, 16 Sep 2024 12:13:33 -0300 Subject: [PATCH] fix comments of PR --- app/src/apdu_handler.c | 5 +++-- app/src/apdu_handler_legacy.h | 2 ++ app/src/common/tx.c | 2 +- tests_zemu/tests/legacy.test.ts | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/apdu_handler.c b/app/src/apdu_handler.c index 18b5abb..86e31f5 100644 --- a/app/src/apdu_handler.c +++ b/app/src/apdu_handler.c @@ -32,6 +32,7 @@ #include "view_internal.h" #include "zxmacros.h" +// This is for backward compatibility with the legacy app, we need to redefine some instructions #undef INS_GET_VERSION #define INS_GET_VERSION 0x20 #undef INS_GET_ADDR @@ -224,13 +225,13 @@ void handleApdu(volatile uint32_t *flags, volatile uint32_t *tx, uint32_t rx) { case BCOMP_VERIFY_ADDRESS: { CHECK_PIN_VALIDATED() - legacy_handleGetAddr(flags, tx, rx, 1); + legacy_handleGetAddr(flags, tx, rx, LEGACY_SHOW_ADDRESS); break; } case BCOMP_GET_PUBKEY: { CHECK_PIN_VALIDATED() - legacy_handleGetAddr(flags, tx, rx, 0); + legacy_handleGetAddr(flags, tx, rx, LEGACY_NOT_SHOW_ADDRESS); break; } diff --git a/app/src/apdu_handler_legacy.h b/app/src/apdu_handler_legacy.h index d671c54..f9a17e2 100644 --- a/app/src/apdu_handler_legacy.h +++ b/app/src/apdu_handler_legacy.h @@ -32,6 +32,8 @@ extern "C" { #define LEGACY_HDPATH_LEN_BYTES 1 #define LEGACY_TRANSFER_NUM_ITEMS 12 #define LEGACY_LOCAL_BUFFER_SIZE 33 +#define LEGACY_NOT_SHOW_ADDRESS 0 +#define LEGACY_SHOW_ADDRESS 1 void legacy_handleGetVersion(volatile uint32_t *tx); void legacy_handleGetAddr(volatile uint32_t *flags, volatile uint32_t *tx, uint32_t rx, const uint8_t requireConfirmation); diff --git a/app/src/common/tx.c b/app/src/common/tx.c index ae38ffa..8c10445 100644 --- a/app/src/common/tx.c +++ b/app/src/common/tx.c @@ -41,7 +41,7 @@ tx_type_t tx_type; // Flash typedef struct { uint8_t buffer[FLASH_BUFFER_SIZE]; - uint8_t templete_json[FLASH_BUFFER_SIZE]; + uint8_t templete_json[TEMPLATE_JSON_BUFFER_SIZE]; } storage_t; #if defined(TARGET_NANOS) || defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX) diff --git a/tests_zemu/tests/legacy.test.ts b/tests_zemu/tests/legacy.test.ts index 87a1d8e..6bd0fa4 100644 --- a/tests_zemu/tests/legacy.test.ts +++ b/tests_zemu/tests/legacy.test.ts @@ -201,7 +201,7 @@ describe.each(HASH_TEST_CASES)('Hash transactions', function (data) { }) describe.each(TRANSACTIONS_TEST_CASES)('Tx transfer', function (data) { - test.only.each(models)('sign transfer tx', async function (m) { + test.concurrent.each(models)('sign transfer tx', async function (m) { const sim = new Zemu(m.path) try { await sim.start({ ...defaultOptions, model: m.name })