diff --git a/.github/workflows/build_and_functional_tests.yml b/.github/workflows/build_and_functional_tests.yml index 1782c76f6..9b9346786 100644 --- a/.github/workflows/build_and_functional_tests.yml +++ b/.github/workflows/build_and_functional_tests.yml @@ -23,7 +23,7 @@ jobs: uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 with: upload_app_binaries_artifact: "compiled_app_binaries" - flags: "DEBUG=0 COIN=bitcoin_testnet" + flags: "DEBUG=0 COIN=acre_testnet" ragger_tests: name: Run ragger tests using the reusable workflow diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 1e4f3c30a..325c919df 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -40,9 +40,9 @@ jobs: - name: Build run: | - make DEBUG=0 COIN=bitcoin BOLOS_SDK=${{ matrix.SDK }} && mv bin/ acre-bin/ + make DEBUG=0 COIN=acre BOLOS_SDK=${{ matrix.SDK }} && mv bin/ acre-bin/ make clean - make DEBUG=0 COIN=bitcoin_testnet BOLOS_SDK=${{ matrix.SDK }} && mv bin/ acre-testnet-bin/ + make DEBUG=0 COIN=acre_testnet BOLOS_SDK=${{ matrix.SDK }} && mv bin/ acre-testnet-bin/ - name: Upload Acre app binary uses: actions/upload-artifact@v4 with: diff --git a/Makefile b/Makefile index ca27cc75a..519209f48 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ include $(BOLOS_SDK)/Makefile.defines CURVE_APP_LOAD_PARAMS = secp256k1 # Application allowed derivation paths. -PATH_APP_LOAD_PARAMS = "44'/0'" "44'/1'" "84'/0'" "84'/1'" "86'/0'" "86'/1'" +PATH_APP_LOAD_PARAMS = "44'/0'" "44'/1'" "48'/0'" "48'/1'" "49'/0'" "49'/1'" "84'/0'" "84'/1'" "86'/0'" "86'/1'" # Allowed SLIP21 paths PATH_SLIP21_APP_LOAD_PARAMS = "LEDGER-Wallet policy" @@ -47,7 +47,7 @@ PATH_SLIP21_APP_LOAD_PARAMS = "LEDGER-Wallet policy" # Application version APPVERSION_M = 1 APPVERSION_N = 0 -APPVERSION_P = 1 +APPVERSION_P = 2 APPVERSION_SUFFIX = # if not empty, appended at the end. Do not add a dash. ifeq ($(APPVERSION_SUFFIX),) @@ -65,11 +65,11 @@ endif # Setting to allow building variant applications VARIANT_PARAM = COIN -VARIANT_VALUES = bitcoin_testnet bitcoin +VARIANT_VALUES = acre_testnet acre # simplify for tests ifndef COIN -COIN=bitcoin_testnet +COIN=acre_testnet endif ######################################## @@ -79,7 +79,7 @@ HAVE_APPLICATION_FLAG_DERIVE_MASTER = 1 HAVE_APPLICATION_FLAG_BOLOS_SETTINGS = 1 HAVE_APPLICATION_FLAG_LIBRARY = 1 -ifeq ($(COIN),bitcoin_testnet) +ifeq ($(COIN),acre_testnet) # Bitcoin testnet, no legacy support DEFINES += BIP32_PUBKEY_VERSION=0x043587CF DEFINES += BIP44_COIN_TYPE=1 @@ -89,7 +89,7 @@ ifeq ($(COIN),bitcoin_testnet) DEFINES += COIN_COINID_SHORT=\"TEST\" APPNAME = "Acre Test" -else ifeq ($(COIN),bitcoin) +else ifeq ($(COIN),acre) # the version for performance tests automatically approves all requests # there is no reason to ever compile the mainnet app with this flag ifneq ($(AUTOAPPROVE_FOR_PERF_TESTS),0) @@ -108,7 +108,7 @@ else ifeq ($(COIN),bitcoin) else ifeq ($(filter clean,$(MAKECMDGOALS)),) - $(error Unsupported COIN - use bitcoin_testnet, bitcoin) + $(error Unsupported COIN - use acre_testnet, acre) endif endif diff --git a/tests/README.md b/tests/README.md index af47c7e34..332897671 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,10 +1,12 @@ -# End-to-end tests +# End-to-end Tests -These tests are implemented in Python and can be executed either using the [Speculos](https://github.com/LedgerHQ/speculos) emulator or a Ledger Nano S/X. +These tests are implemented in Python and can be executed using either the [Speculos](https://github.com/LedgerHQ/speculos) emulator or a physical Ledger Nano X/SP/Flex or Stax device. The tests require an x86_64 architecture. + +Note: If you're using the Ledger Developer Extension, some tests (those containing "e2e" in their names) may not run properly due to missing libraries in the Docker image. All the commands in this folder are meant to be ran from the `tests` folder, not from the root. -Python dependencies are listed in [requirements.txt](requirements.txt), install them using [pip](https://pypi.org/project/pip/) +Python dependencies are listed in [requirements.txt](requirements.txt), install them using [pip](https://pypi.org/project/pip/). ``` pip install -r requirements.txt @@ -16,6 +18,13 @@ Some tests require the `bitcoind 22.0` binary to be in the `$PATH` variable, or export BITCOIND=/path/to/my/bitcoind ``` +You may also need to install the following dependencies to run the end to end tests: + +``` +sudo apt-get update && sudo apt-get install -y qemu-user-static tesseract-ocr libtesseract-dev +pip install -U pip setuptools +``` + ## Launch with Speculos Build the app as normal from the root folder. For convenience, you probably want to enable DEBUG: @@ -29,6 +38,7 @@ Then run all the tests from this folder, specifying the device: nanox, nanosp, s ``` pytest --device yourdevice ``` + You can enable the screen display with the option `--display` ## Launch with your Nano S/X/SP or Stax @@ -45,4 +55,4 @@ Be sure to have you device connected through USB (without any other software int ``` pytest --device yourdevice --backend ledgercomm -``` \ No newline at end of file +``` diff --git a/tests/snapshots/flex/test_dashboard/00001.png b/tests/snapshots/flex/test_dashboard/00001.png index ca5fc554f..351a54932 100644 Binary files a/tests/snapshots/flex/test_dashboard/00001.png and b/tests/snapshots/flex/test_dashboard/00001.png differ diff --git a/tests/snapshots/nanosp/test_dashboard/00001.png b/tests/snapshots/nanosp/test_dashboard/00001.png index 2b89efe14..104e14f90 100644 Binary files a/tests/snapshots/nanosp/test_dashboard/00001.png and b/tests/snapshots/nanosp/test_dashboard/00001.png differ diff --git a/tests/snapshots/nanox/test_dashboard/00001.png b/tests/snapshots/nanox/test_dashboard/00001.png index 2b89efe14..104e14f90 100644 Binary files a/tests/snapshots/nanox/test_dashboard/00001.png and b/tests/snapshots/nanox/test_dashboard/00001.png differ diff --git a/tests/snapshots/stax/test_dashboard/00001.png b/tests/snapshots/stax/test_dashboard/00001.png index 51cc80ee0..52797247a 100644 Binary files a/tests/snapshots/stax/test_dashboard/00001.png and b/tests/snapshots/stax/test_dashboard/00001.png differ