diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 124d69e7..e203aa1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: - name : Install yarn run: npm install --global yarn - name: Install Cardano JS Library (Ledger fork) - run: git clone https://github.com/LedgerHQ/ledgerjs-cardano-shelley.git + run: git clone https://github.com/vacuumlabs/ledgerjs-cardano-shelley.git - name : Run tests run: | BUILD_DEVICE_NAME="$(echo ${{ matrix.device }} | sed 's/nanosp/nanos2/')" diff --git a/Makefile b/Makefile index 559b95bc..e0025416 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,8 @@ APPNAME = "Cardano ADA" # Application version APPVERSION_M = 7 -APPVERSION_N = 2 -APPVERSION_P = 0 +APPVERSION_N = 1 +APPVERSION_P = 2 APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" # Application source files @@ -56,7 +56,7 @@ VARIANT_VALUES = cardano_ada DEFINES += RESET_ON_CRASH # Enabling DEBUG flag will enable PRINTF and disable optimizations -# DEVEL = 1 +DEVEL = 1 # DEFINES += HEADLESS # Enabling debug PRINTF diff --git a/src/ui_nbgl.c b/src/ui_nbgl.c index 826d41a8..79d63311 100644 --- a/src/ui_nbgl.c +++ b/src/ui_nbgl.c @@ -33,15 +33,15 @@ enum { }; typedef enum { - STATUS_TYPE_TRANSACTION, - STATUS_TYPE_ADDRESS, + STATUS_TYPE_TRANSACTION, + STATUS_TYPE_ADDRESS, } statusType_t; typedef struct { bool standardStatus; - statusType_t statusType; - const char* confirmedStatus; // text displayed in confirmation page (after long press) - const char* rejectedStatus; // text displayed in rejection page (after reject confirmed) + statusType_t statusType; + const char* confirmedStatus; // text displayed in confirmation page (after long press) + const char* rejectedStatus; // text displayed in rejection page (after reject confirmed) callback_t approvedCallback; callback_t rejectedCallback; callback_t pendingDisplayPageFn; @@ -130,8 +130,8 @@ static void reset_transaction_current_context(void) void nbgl_reset_transaction_full_context(void) { reset_transaction_current_context(); - uiContext.standardStatus = false; - uiContext.statusType = STATUS_TYPE_TRANSACTION; + uiContext.standardStatus = false; + uiContext.statusType = STATUS_TYPE_TRANSACTION; uiContext.pendingElement = 0; uiContext.lightConfirmation = false; uiContext.rejectedStatus = NULL; @@ -259,15 +259,18 @@ static void display_cancel_status(void) if (uiContext.rejectedStatus) { nbgl_useCaseStatus(uiContext.rejectedStatus, false, cancellation_status_callback); - } else { - switch (uiContext.statusType) { - case STATUS_TYPE_TRANSACTION: - nbgl_useCaseReviewStatus(STATUS_TYPE_TRANSACTION_REJECTED, cancellation_status_callback); - break; - case STATUS_TYPE_ADDRESS: - nbgl_useCaseReviewStatus(STATUS_TYPE_ADDRESS_REJECTED, cancellation_status_callback); - break; - } + } + else { + switch (uiContext.statusType) { + case STATUS_TYPE_TRANSACTION: + nbgl_useCaseReviewStatus(STATUS_TYPE_TRANSACTION_REJECTED, + cancellation_status_callback); + break; + case STATUS_TYPE_ADDRESS: + nbgl_useCaseReviewStatus(STATUS_TYPE_ADDRESS_REJECTED, + cancellation_status_callback); + break; + } } } @@ -544,14 +547,14 @@ void display_address(callback_t userAcceptCallback, callback_t userRejectCallbac TRACE("Displaying Address"); set_callbacks(userAcceptCallback, userRejectCallback); - uint8_t address_index = 0; + uint8_t address_index = 0; // Address field is not displayed in pairList, so there is one element less. uiContext.pairList.nbPairs = uiContext.currentElementCount - 1; uiContext.pairList.pairs = tagValues; - uiContext.standardStatus = true; - uiContext.statusType = STATUS_TYPE_ADDRESS; + uiContext.standardStatus = true; + uiContext.statusType = STATUS_TYPE_ADDRESS; for (uint8_t i = 0; i < uiContext.currentElementCount; i++) { if (strcmp(uiContext.tagTitle[i], "Address")) { @@ -562,12 +565,9 @@ void display_address(callback_t userAcceptCallback, callback_t userRejectCallbac } } - nbgl_useCaseAddressReview(uiContext.tagContent[address_index], - &uiContext.pairList, - &C_cardano_64, - "Verify Cardano address", - NULL, - light_confirm_callback); + nbgl_useCaseAddressReview(uiContext.tagContent[address_index], &uiContext.pairList, + &C_cardano_64, "Verify Cardano address", NULL, + light_confirm_callback); reset_transaction_current_context(); #ifdef HEADLESS