Skip to content

Commit

Permalink
fix comments of PR
Browse files Browse the repository at this point in the history
  • Loading branch information
abenso committed Sep 16, 2024
1 parent e680aed commit 30fd91e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions app/src/apdu_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions app/src/apdu_handler_legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/src/common/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests_zemu/tests/legacy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down

0 comments on commit 30fd91e

Please sign in to comment.