Skip to content

Commit

Permalink
Merge pull request #128 from LedgerHQ/tdj/remove_nanoS_support
Browse files Browse the repository at this point in the history
remove the nanoS support in boilerplate
  • Loading branch information
tdejoigny-ledger authored Jul 30, 2024
2 parents d7a48b2 + eacb213 commit a08a798
Show file tree
Hide file tree
Showing 45 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Analyse
strategy:
matrix:
sdk: [ "$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK" ]
sdk: ["$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK", "$FLEX_SDK"]
#'cpp' covers C and C++
language: [ 'cpp' ]
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"env": {
"BOLOS_SDK": "/opt/nanos-secure-sdk",
"BOLOS_SDK": "/opt/nanosplus-secure-sdk",
"BOLOS_ENV": "/opt/bolos-devenv"
},
"configurations": [
{
"name": "Nano S",
"name": "Nano S+",
"includePath": [
"/usr/include",
"${workspaceFolder}/src",
"${env:BOLOS_SDK}/include/*",
"${env:BOLOS_SDK}/lib_ux/include/*"
],
"defines": [
"TARGET_NANOS",
"TARGET_NANOS2",
"OS_IO_SEPROXYHAL",
"HAVE_BAGL",
"HAVE_SPRINTF",
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ APP_SOURCE_PATH += src

# Application icons following guidelines:
# https://developers.ledger.com/docs/embedded-app/design-requirements/#device-icon
ICON_NANOS = icons/app_boilerplate_16px.gif
ICON_NANOX = icons/app_boilerplate_14px.gif
ICON_NANOSP = icons/app_boilerplate_14px.gif
ICON_STAX = icons/app_boilerplate_32px.gif
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Ledger Boilerplate Application

This is a boilerplate application which can be forked to start a new project for the Ledger Nano S/X/SP and Stax.
This is a boilerplate application which can be forked to start a new project for the Ledger Nano X/SP, Stax and Flex.

## Quick start guide

Expand Down Expand Up @@ -77,12 +77,11 @@ make DEBUG=1 # compile optionally with PRINTF

You can choose which device to compile and load for by setting the `BOLOS_SDK` environment variable to the following values :

* `BOLOS_SDK=$NANOS_SDK`
* `BOLOS_SDK=$NANOX_SDK`
* `BOLOS_SDK=$NANOSP_SDK`
* `BOLOS_SDK=$STAX_SDK`

By default this variable is set to build/load for Nano S.
By default this variable is set to build/load for Nano S+.

### Loading on a physical device

Expand All @@ -105,7 +104,7 @@ Then once you have [opened a terminal](#with-a-terminal) in the `app-builder` im

```shell
# Run this command from the app-builder container terminal.
make load # load the app on a Nano S by default
make load # load the app on a Nano S+ by default
```

[Setting the BOLOS_SDK environment variable](#compilation-and-load) will allow you to load on whichever supported device you want.
Expand Down Expand Up @@ -168,16 +167,16 @@ pip install -r tests/requirements.txt

Then you can :

Run the functional tests (here for nanos but available for any device once you have built the binaries) :
Run the functional tests (here for nanos+ but available for any device once you have built the binaries) :

```shell
pytest tests/ --tb=short -v --device nanos
pytest tests/ --tb=short -v --device nanosp
```

Or run your app directly with Speculos

```shell
speculos --model nanos build/nanos/bin/app.elf
speculos --model nanosp build/nanos2/bin/app.elf
```

## Documentation
Expand Down Expand Up @@ -207,7 +206,7 @@ It outputs 3 artifacts:
- `code-coverage` within HTML details of code coverage
- `documentation` within HTML auto-generated documentation

## Are you developing a Nano S, S Plus, X application?
## Are you developing an application for Ledger devices?

If so, This boilerplate will help you get started.

Expand Down
2 changes: 1 addition & 1 deletion ledger_app.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[app]
build_directory = "./"
sdk = "C"
devices = ["nanos", "nanox", "nanos+", "stax", "flex"]
devices = ["nanox", "nanos+", "stax", "flex"]

[tests]
unit_directory = "./unit-tests/"
Expand Down
Binary file removed tests/snapshots/nanos/test_app_mainmenu/00000.png
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_app_mainmenu/00001.png
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_app_mainmenu/00002.png
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_app_mainmenu/00003.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_sign_tx_long_tx/00000.png
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_sign_tx_long_tx/00001.png
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_sign_tx_long_tx/00002.png
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_sign_tx_long_tx/00003.png
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_sign_tx_long_tx/00004.png
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_sign_tx_long_tx/00005.png
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_sign_tx_long_tx/00006.png
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_sign_tx_refused/00000.png
Binary file not shown.
Binary file removed tests/snapshots/nanos/test_sign_tx_refused/00001.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_refused/00002.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_refused/00003.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_refused/00004.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_refused/00005.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_refused/00006.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_refused/00007.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_short_tx/00000.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_short_tx/00001.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_short_tx/00002.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_short_tx/00003.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_short_tx/00004.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_short_tx/00005.png
Diff not rendered.
Binary file removed tests/snapshots/nanos/test_sign_tx_short_tx/00006.png
Diff not rendered.
6 changes: 3 additions & 3 deletions tests/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You can use for this the container `ghcr.io/ledgerhq/ledger-app-builder/ledger-a
docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
cd <your app repository> # replace <appname> with the name of your app, (eg boilerplate)
docker run --user "$(id -u)":"$(id -g)" --rm -ti -v "$(realpath .):/app" --privileged -v "/dev/bus/usb:/dev/bus/usb" ledger-app-builder-lite:latest
make clean && make BOLOS_SDK=$<device>_SDK # replace <device> with one of [NANOS, NANOX, NANOSP, STAX]
make clean && make BOLOS_SDK=$<device>_SDK # replace <device> with one of [NANOX, NANOSP, STAX, FLEX]
exit
```

Expand All @@ -41,7 +41,7 @@ You can use for this the container `ghcr.io/ledgerhq/ledger-app-builder/ledger-a
docker pull ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
cd app-<appname>/ # replace <appname> with the name of your app, (eg boilerplate)
docker run --user "$(id -u)":"$(id -g)" --rm -ti -v "$(realpath .):/app" --privileged -v "/dev/bus/usb:/dev/bus/usb" ledger-app-builder-lite:latest
make clean && make BOLOS_SDK=$<device>_SDK load # replace <device> with one of [NANOS, NANOX, NANOSP, STAX]
make clean && make BOLOS_SDK=$<device>_SDK load # replace <device> with one of [NANOX, NANOSP, STAX, FLEX]
exit
```

Expand All @@ -65,7 +65,7 @@ Standard useful pytest options

Custom pytest options
```
--device <device> run the test on the specified device [nanos,nanox,nanosp,stax,all]. This parameter is mandatory
--device <device> run the test on the specified device [nanox,nanosp,stax,flex,all]. This parameter is mandatory
--backend <backend> run the tests against the backend [speculos, ledgercomm, ledgerwallet]. Speculos is the default
--display on Speculos, enables the display of the app screen using QT
--golden_run on Speculos, screen comparison functions will save the current screen instead of comparing
Expand Down

0 comments on commit a08a798

Please sign in to comment.