Skip to content
Merged

Dev #351

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ jobs:

- name: Upload Snapshots (only failure)
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: snapshots-tmp
path: tests_zemu/snapshots-tmp/
Expand Down
43 changes: 23 additions & 20 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ ifneq ($(TARGET_NAME), TARGET_NANOS)
FEATURE_ETH = 1
endif

include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.installer_script
include $(BOLOS_SDK)/Makefile.defines

## Display whether this is a production build or for internal use
ifeq ($(PRODUCTION_BUILD), 1)
$(info ************ PRODUCTION_BUILD = [PRODUCTION BUILD])
Expand All @@ -48,6 +45,9 @@ ifndef COIN
COIN = AVAX
endif

VARIANT_PARAM=COIN
VARIANT_VALUES=$(COIN)

include $(CURDIR)/Makefile.version

$(info COIN = [$(COIN)])
Expand Down Expand Up @@ -76,14 +76,18 @@ else
APP_STACK_MIN_SIZE := 2000
endif

# Enable QR code display for all devices
ENABLE_NBGL_QRCODE ?= 1

RUST_TARGET:=thumbv6m-none-eabi

$(info ************ RUST_TARGET = [$(RUST_TARGET)])

include $(BOLOS_SDK)/Makefile.target

include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.devices

$(info TARGET_NAME = [$(TARGET_NAME)])
$(info ICONNAME = [$(ICONNAME)])

ifndef ICONNAME
$(error ICONNAME is not set)
endif

# Add SDK BLAKE2b
DEFINES += HAVE_HASH HAVE_BLAKE2
Expand Down Expand Up @@ -221,17 +225,23 @@ endif

CFLAGS += -DAPPVERSION_M=$(APPVERSION_M) -DAPPVERSION_N=$(APPVERSION_N) -DAPPVERSION_P=$(APPVERSION_P)

AS := $(GCCPATH)arm-none-eabi-gcc
AFLAGS +=

LD := $(GCCPATH)arm-none-eabi-gcc
LDFLAGS += -z muldefs
LDLIBS += -lm -lgcc -lc
LDLIBS += -L$(MY_DIR)rust/target/$(RUST_TARGET)/release -lrslib

APP_SOURCE_PATH += $(CURDIR)/rust/include
APP_CUSTOM_LINK_DEPENDENCIES := rust

include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.installer_script

$(info TARGET_NAME = [$(TARGET_NAME)])
$(info ICONNAME = [$(ICONNAME)])

ifndef ICONNAME
$(error ICONNAME is not set)
endif

# make rust a prerequisite for all object files
$(OBJECT_FILES): | rust

.PHONY: rust
rust:
Expand All @@ -245,15 +255,8 @@ rust_clean:

clean: rust_clean

include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.side_loading

include $(BOLOS_SDK)/Makefile.rules


dep/%.d: %.c Makefile

listvariants:
@echo VARIANTS COIN AVAX

.PHONY: version
version:
Expand Down
2 changes: 1 addition & 1 deletion app/Makefile.version
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ APPVERSION_M=1
# Minor
APPVERSION_N=1
# Patch
APPVERSION_P=4
APPVERSION_P=5
16 changes: 8 additions & 8 deletions app/src/apdu_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ __Z_INLINE void handleSignAvaxMsg(volatile uint32_t *flags, volatile uint32_t *t
}

view_review_init(tx_getItem, tx_getNumItems, app_sign_msg);
view_review_show(REVIEW_TXN);
view_review_show(REVIEW_MSG);
*flags |= IO_ASYNCH_REPLY;
}

Expand All @@ -291,14 +291,14 @@ __Z_INLINE void handle_getversion(__Z_UNUSED volatile uint32_t *flags, volatile
G_io_apdu_buffer[0] = 0x01;
#endif

G_io_apdu_buffer[1] = (LEDGER_MAJOR_VERSION >> 8) & 0xFF;
G_io_apdu_buffer[2] = (LEDGER_MAJOR_VERSION >> 0) & 0xFF;
G_io_apdu_buffer[1] = (MAJOR_VERSION >> 8) & 0xFF;
G_io_apdu_buffer[2] = (MAJOR_VERSION >> 0) & 0xFF;

G_io_apdu_buffer[3] = (LEDGER_MINOR_VERSION >> 8) & 0xFF;
G_io_apdu_buffer[4] = (LEDGER_MINOR_VERSION >> 0) & 0xFF;
G_io_apdu_buffer[3] = (MINOR_VERSION >> 8) & 0xFF;
G_io_apdu_buffer[4] = (MINOR_VERSION >> 0) & 0xFF;

G_io_apdu_buffer[5] = (LEDGER_PATCH_VERSION >> 8) & 0xFF;
G_io_apdu_buffer[6] = (LEDGER_PATCH_VERSION >> 0) & 0xFF;
G_io_apdu_buffer[5] = (PATCH_VERSION >> 8) & 0xFF;
G_io_apdu_buffer[6] = (PATCH_VERSION >> 0) & 0xFF;

G_io_apdu_buffer[7] = !IS_UX_ALLOWED;

Expand Down Expand Up @@ -450,7 +450,7 @@ __Z_INLINE void handleSignEthMsg(volatile uint32_t *flags, volatile uint32_t *tx
}

view_review_init_progressive(tx_getItem, tx_getNumItems, app_sign_eth);
view_review_show(REVIEW_TXN);
view_review_show(REVIEW_MSG);

*flags |= IO_ASYNCH_REPLY;
}
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 @@ -17,7 +17,7 @@
#include "tx.h"
#include "apdu_codes.h"
#include "buffering.h"
#include "parser.h"
#include "common/parser.h"
#include "parser_common.h"
#include <string.h>
#include "zxmacros.h"
Expand Down
4 changes: 2 additions & 2 deletions app/src/network_icons.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include "os_utils.h"
#include "os_pic.h"
#include "zxmacros.h"

// Replace function from ethereum app to skip icon generation
#if defined(TARGET_STAX) || defined(TARGET_FLEX)
#include "nbgl_types.h"
#include "glyphs.h"

const nbgl_icon_details_t *get_network_icon_from_chain_id(const uint64_t *chain_id)
const nbgl_icon_details_t *get_network_icon_from_chain_id(__Z_UNUSED const uint64_t *chain_id)
{
UNUSED(chain_id);
const nbgl_icon_details_t *icon = NULL;

icon = &ICONGLYPH;
Expand Down
2 changes: 1 addition & 1 deletion app/src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
********************************************************************************/

#include "parser.h"
#include "common/parser.h"

#include <stdio.h>
#include <zxformat.h>
Expand Down
14 changes: 7 additions & 7 deletions tests_zemu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@
},
"dependencies": {
"@ethersproject/wallet": "^5.7.0",
"@types/node": "^22.10.9",
"@types/node": "^22.13.1",
"@zondax/ledger-avalanche-app": "link:../js",
"@zondax/zemu": "0.53.0",
"@zondax/zemu": "0.54.0",
"ethers": "^6.13.5"
},
"devDependencies": {
"@ethereumjs/common": "^4.4.0",
"@ethereumjs/rlp": "^5.0.2",
"@ethereumjs/tx": "^5.4.0",
"@ethereumjs/util": "^9.1.0",
"@ledgerhq/hw-app-eth": "6.42.3",
"@ledgerhq/hw-app-eth": "6.42.5",
"@ledgerhq/hw-transport-node-hid": "^6.29.5",
"@ledgerhq/logs": "^6.12.0",
"@matteoh2o1999/github-actions-jest-reporter": "^3.0.0",
"@types/bs58": "^4.0.4",
"@types/elliptic": "^6.4.18",
"@types/jest": "^29.5.14",
"@types/ledgerhq__hw-transport": "^4.21.8",
"@typescript-eslint/eslint-plugin": "^8.21.0",
"@typescript-eslint/parser": "^8.21.0",
"@typescript-eslint/eslint-plugin": "^8.24.0",
"@typescript-eslint/parser": "^8.24.0",
"bn.js": "^5.2.1",
"bs58": "^6.0.0",
"crypto-js": "4.2.0",
"elliptic": "^6.6.1",
"eslint": "^9.18.0",
"eslint": "^9.20.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.11.0",
Expand All @@ -50,7 +50,7 @@
"jest-serial-runner": "^1.2.1",
"js-sha256": "0.11.0",
"jssha": "^3.3.1",
"prettier": "^3.4.2",
"prettier": "^3.5.0",
"secp256k1": "^5.0.1",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
Expand Down
Binary file modified tests_zemu/snapshots/fl-eth-sign-message-complex_nav/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-eth-sign-message-complex_nav/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-eth-sign-message/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-eth-sign-message/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-mainmenu/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-mainmenu/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-mainmenu/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-mainmenu/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-sign-msg/00000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/fl-sign-msg/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00005.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00011.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00012.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00013.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message-complex_nav/00014.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00000.png
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00001.png
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00002.png
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00003.png
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00004.png
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00005.png
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00006.png
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00007.png
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00008.png
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00009.png
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00010.png
Binary file modified tests_zemu/snapshots/s-eth-sign-message/00011.png
Binary file added tests_zemu/snapshots/s-eth-sign-message/00012.png
Binary file modified tests_zemu/snapshots/s-mainmenu/00004.png
Binary file modified tests_zemu/snapshots/s-mainmenu/00010.png
Binary file modified tests_zemu/snapshots/s-sign-msg/00000.png
Binary file modified tests_zemu/snapshots/s-sign-msg/00001.png
Binary file modified tests_zemu/snapshots/s-sign-msg/00002.png
Binary file modified tests_zemu/snapshots/s-sign-msg/00003.png
Binary file modified tests_zemu/snapshots/sp-eth-sign-message/00000.png
Binary file modified tests_zemu/snapshots/sp-mainmenu/00004.png
Binary file modified tests_zemu/snapshots/sp-mainmenu/00010.png
Binary file modified tests_zemu/snapshots/sp-sign-msg/00000.png
Binary file modified tests_zemu/snapshots/st-eth-sign-message-complex_nav/00000.png
Binary file modified tests_zemu/snapshots/st-eth-sign-message-complex_nav/00003.png
Binary file modified tests_zemu/snapshots/st-eth-sign-message/00000.png
Binary file modified tests_zemu/snapshots/st-eth-sign-message/00003.png
Binary file modified tests_zemu/snapshots/st-mainmenu/00001.png
Binary file modified tests_zemu/snapshots/st-mainmenu/00002.png
Binary file modified tests_zemu/snapshots/st-mainmenu/00003.png
Binary file modified tests_zemu/snapshots/st-mainmenu/00004.png
Binary file modified tests_zemu/snapshots/st-sign-msg/00000.png
Binary file modified tests_zemu/snapshots/st-sign-msg/00002.png
Binary file modified tests_zemu/snapshots/x-eth-sign-message/00000.png
Binary file modified tests_zemu/snapshots/x-mainmenu/00004.png
Binary file modified tests_zemu/snapshots/x-mainmenu/00010.png
Binary file modified tests_zemu/snapshots/x-sign-msg/00000.png
2 changes: 1 addition & 1 deletion tests_zemu/tests/eth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ describe.each(models)('Ethereum Personal Message [%s] - misc', function (m) {
const respReq = app.signPersonalMessage(ETH_DERIVATION, msgData.toString('hex'))

if (m.name === 'nanos') {
await sim.navigateAndCompareSnapshots('.', testcase, [5, -4, 3, 0, 0])
await sim.navigateAndCompareSnapshots('.', testcase, [6, -4, 3, 0, 0])
} else if (m.name === 'nanox' || m.name === 'nanosp') {
await sim.navigateAndCompareSnapshots('.', testcase, [9, -4, 3, 0, 0])
} else {
Expand Down
Loading
Loading