Skip to content

Commit

Permalink
Merge pull request #28 from LedgerHQ/develop
Browse files Browse the repository at this point in the history
0.5.7 release
  • Loading branch information
apaillier-ledger authored May 23, 2024
2 parents 5fa3c8a + ba0235b commit 5089b38
Show file tree
Hide file tree
Showing 35 changed files with 522 additions and 312 deletions.
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Checklist
<!-- Put an `x` in each box when you have completed the items. -->
- [ ] App update process has been followed <!-- See comment below -->
- [ ] Target branch is `develop` <!-- unless you have a very good reason -->
- [ ] Application version has been bumped <!-- required if your changes are to be deployed -->

<!-- Make sure you followed the process described in https://developers.ledger.com/docs/embedded-app/maintenance/ before opening your Pull Request.
Don't hesitate to contact us directly on Discord if you have any questions ! https://developers.ledger.com/discord -->
73 changes: 11 additions & 62 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,78 +12,27 @@ on:
- develop

jobs:
nanoS_build:
name: Nano S build
runs-on: ubuntu-latest
timeout-minutes: 10

container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest

steps:
- name: Clone
uses: actions/checkout@v2

- name: Build
run: |
make clean
make
- name: Upload app binary
uses: actions/upload-artifact@v2
with:
name: nanoS-app
path: bin

nanoX_build:
name: Nano X build
runs-on: ubuntu-latest
timeout-minutes: 10

container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest

steps:
- name: Clone
uses: actions/checkout@v2

- name: Build
run: |
make clean
make BOLOS_SDK=$NANOX_SDK
nanoSP_build:
name: Nano S+ build
runs-on: ubuntu-latest
timeout-minutes: 10

container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest

steps:
- name: Clone
uses: actions/checkout@v2

- name: Build
run: |
make clean
make BOLOS_SDK=$NANOSP_SDK
app-build:
name: Build app
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
upload_app_binaries_artifact: "binaries"

tests:
name: Functional tests
runs-on: ubuntu-latest
timeout-minutes: 10
needs:
- nanoS_build
- app-build

steps:
- name: Clone
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Download app binary
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: nanoS-app
name: binaries
path: bin

- name: Install Speculos
Expand All @@ -92,7 +41,7 @@ jobs:
pip install --extra-index-url https://test.pypi.org/simple/ speculos
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16

Expand All @@ -104,4 +53,4 @@ jobs:
- name: Running tests
run: ./tests/node_modules/.bin/mocha tests/ --exit --require tests/hooks.js --config tests/.mocharc.js "$@"
env:
LEDGER_APP: bin/app.elf
LEDGER_APP: bin/nanos/bin/app.elf
23 changes: 23 additions & 0 deletions .github/workflows/guidelines_enforcer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Ensure compliance with Ledger guidelines

# This workflow is mandatory in all applications
# It calls a reusable workflow guidelines_enforcer developed by Ledger's internal developer team.
# The successful completion of the reusable workflow is a mandatory step for an app to be available on the Ledger
# application store.
#
# More information on the guidelines can be found in the repository:
# LedgerHQ/ledger-app-workflows/

on:
workflow_dispatch:
push:
branches:
- master
- main
- develop
pull_request:

jobs:
guidelines_enforcer:
name: Call Ledger guidelines_enforcer
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/debug
/dep
/obj
build/

node_modules/
src/glyphs.h
Expand Down
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
This project's release branch is `master`.
This log is written from the perspective of the release branch: when changes hit `master`, they are considered released.

## v0.5.7 - 2023-11-08

### Release Notes

- Stax support

## v0.5.6 - 2023-02-27

### Release Notes
Expand Down
40 changes: 28 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ include $(BOLOS_SDK)/Makefile.defines

APPNAME = "Nervos"

APP_LOAD_PARAMS= --appFlags 0 --curve secp256k1 --path "44'/309'" $(COMMON_LOAD_PARAMS)
APP_LOAD_PARAMS= --curve secp256k1 --path "44'/309'" $(COMMON_LOAD_PARAMS)

GIT_DESCRIBE ?= $(shell git describe --tags --abbrev=8 --always --long --dirty 2>/dev/null)

VERSION_TAG ?= $(shell echo "$(GIT_DESCRIBE)" | cut -f1 -d-)
APPVERSION_M=0
APPVERSION_N=5
APPVERSION_P=6
APPVERSION_P=7
APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)

# Only warn about version tags if specified/inferred
Expand All @@ -33,7 +33,9 @@ endif

ifeq ($(TARGET_NAME),TARGET_NANOS)
ICONNAME=icons/nano-s-nervos.gif
else
else ifeq ($(TARGET_NAME), TARGET_STAX)
ICONNAME=icons/stax_app_nervos.gif
else # NANOX & NANOS+
ICONNAME=icons/nano-x-nervos.gif
endif

Expand All @@ -53,32 +55,43 @@ show-app:
############

DEFINES += OS_IO_SEPROXYHAL
DEFINES += HAVE_BAGL HAVE_SPRINTF
DEFINES += HAVE_SPRINTF
DEFINES += HAVE_IO_USB HAVE_L4_USBLIB IO_USB_MAX_ENDPOINTS=6 IO_HID_EP_LENGTH=64 HAVE_USB_APDU
DEFINES += HAVE_LEGACY_PID
DEFINES += VERSION=\"$(APPVERSION)\" APPVERSION_M=$(APPVERSION_M)
DEFINES += COMMIT=\"$(COMMIT)\" APPVERSION_N=$(APPVERSION_N) APPVERSION_P=$(APPVERSION_P)
# DEFINES += _Static_assert\(...\)=
DEFINES += APPNAME=\"$(APPNAME)\"

ifeq ($(TARGET_NAME),TARGET_NANOX)
ifneq (,$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX))
APP_LOAD_PARAMS += --appFlags 0x240 # with BLE support
DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000
DEFINES += HAVE_BLE_APDU # basic ledger apdu transport over BLE
SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl
else
APP_LOAD_PARAMS += --appFlags 0x000
endif

ifeq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=128
DEFINES += HAVE_UX_FLOW
else
DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300
DEFINES += HAVE_GLO096 HAVE_UX_FLOW
DEFINES += HAVE_BAGL BAGL_WIDTH=128 BAGL_HEIGHT=64
endif

ifeq ($(TARGET_NAME),TARGET_STAX)
DEFINES += NBGL_QRCODE
SDK_SOURCE_PATH += qrcode
else
DEFINES += HAVE_BAGL HAVE_UX_FLOW
ifneq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += HAVE_GLO096
DEFINES += BAGL_WIDTH=128 BAGL_HEIGHT=64
DEFINES += HAVE_BAGL_ELLIPSIS # long label truncation feature
DEFINES += HAVE_BAGL_FONT_OPEN_SANS_REGULAR_11PX
DEFINES += HAVE_BAGL_FONT_OPEN_SANS_EXTRABOLD_11PX
DEFINES += HAVE_BAGL_FONT_OPEN_SANS_LIGHT_16PX
endif
endif

# Enabling debug PRINTF
DEBUG ?= 0
Expand Down Expand Up @@ -106,7 +119,6 @@ ifneq ($(BOLOS_ENV),)
$(info BOLOS_ENV=$(BOLOS_ENV))
CLANGPATH := $(BOLOS_ENV)/clang-arm-fropi/bin/
GCCPATH := $(BOLOS_ENV)/gcc-arm-none-eabi-5_3-2016q1/bin/
CFLAGS += -idirafter $(BOLOS_ENV)/gcc-arm-none-eabi-5_3-2016q1/arm-none-eabi/include
else
$(info BOLOS_ENV is not set: falling back to CLANGPATH and GCCPATH)
endif
Expand All @@ -132,13 +144,11 @@ CC := $(CLANGPATH)clang
AS := $(GCCPATH)$(TOOL_PREFIX)gcc
endif

CFLAGS += -O3 -Os -Wall -Wextra
ifneq ($(USE_NIX),)
CFLAGS += -mcpu=sc000
endif

LD := $(GCCPATH)$(TOOL_PREFIX)gcc
LDFLAGS += -O3 -Os
ifneq ($(USE_NIX),)
LDFLAGS += -mcpu=sc000
endif
Expand All @@ -149,7 +159,11 @@ include $(BOLOS_SDK)/Makefile.glyphs

### computed variables
APP_SOURCE_PATH += src
SDK_SOURCE_PATH += lib_stusb lib_stusb_impl lib_ux
SDK_SOURCE_PATH += lib_stusb lib_stusb_impl

ifneq ($(TARGET_NAME),TARGET_STAX)
SDK_SOURCE_PATH += lib_ux
endif

### U2F support (wallet app only)
SDK_SOURCE_PATH += lib_u2f
Expand All @@ -159,6 +173,8 @@ DEFINES += USB_SEGMENT_SIZE=64
DEFINES += U2F_PROXY_MAGIC=\"CKB\"
DEFINES += HAVE_IO_U2F HAVE_U2F

DEFINES += HAVE_WEBUSB WEBUSB_URL_SIZE_B=0 WEBUSB_URL=""

load: all
python -m ledgerblue.loadApp $(APP_LOAD_PARAMS)

Expand Down
4 changes: 2 additions & 2 deletions fuzzing/ui_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void ui_prompt_debug(size_t screen_count) {
}
}

__attribute__((noreturn)) void ui_prompt_with_cb(void (*switch_screen_cb)(size_t), size_t screen_count,
void ui_prompt_with_cb(void (*switch_screen_cb)(size_t), size_t screen_count,
ui_callback_t ok_c, ui_callback_t cxl_c) {
check_null(switch_screen_cb);
if (screen_count > MAX_SCREEN_COUNT)
Expand All @@ -41,7 +41,7 @@ __attribute__((noreturn)) void ui_prompt_with_cb(void (*switch_screen_cb)(size_t
THROW(ASYNC_EXCEPTION);
}

__attribute__((noreturn)) void ui_prompt(const char *const *labels, ui_callback_t ok_c, ui_callback_t cxl_c) {
void ui_prompt(const char *const *labels, ui_callback_t ok_c, ui_callback_t cxl_c) {
check_null(labels);
global.ui.prompt.prompts = labels;

Expand Down
Binary file added glyphs/stax_nervos_64px.gif
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 icons/nano-s-nervos.gif
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 icons/nano-x-nervos.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/stax_app_nervos.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions ledger_app.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[app]
build_directory = "./"
sdk = "C"
devices = ["nanos", "nanox", "nanos+", "stax"]
Loading

0 comments on commit 5089b38

Please sign in to comment.