LedgerHQ / app-stellar

Stellar app for Ledger Nano S
Apache License 2.0
15 stars 23 forks source link

Ledger Stellar App

Compilation & tests Swap function tests

Introduction

This is the wallet app for the Ledger hardware wallets that makes it possible to store Stellar-based assets on those devices and generally sign any transaction for the Stellar network.

Documentation

This app follows the specification available in the ./docs folder.

SDK

You can communicate with the app through the following libraries:

Building and installing

If not for development purposes, you should install this app via Ledger Live.

To build and install the app on your Nano S or Nano S Plus you must set up the Ledger build environments. Please follow the load the application instructions at the Ledger developer portal.

Additionaly, install this dependency:

sudo apt install libbsd-dev

The command to compile and load the app onto the device is:

make load

To remove the app from the device do:

make delete

Testing

This project provides unit tests, integration tests and end-to-end tests, unit tests are located under the ./tests_unit folder, and the integration tests and end-to-end tests are located under the ./tests_zemu folder.

During development, we recommend that you run the unit test first, as it takes less time to run, and then run the other tests after the unit test has run successfully.

Unit testing

The ./tests_unit directory contains files for testing the utils, the xdr transaction parser and the screen formatter.

They require the Node.js, cmocka unit testing framework, CMake and libbsd to be installed:

sudo apt install libcmocka-dev cmake libbsd-dev

It is recommended to use nvm to install the latest LTS version of Node.js

To build and execute the tests, run the following command:

make tests-unit

Integration testing and end-to-end testing

Testing is done via the open-source framework zemu.

In order to run these tests, you need to install Docker in addition to the dependencies mentioned in Unit testing.

To build and execute the tests, run the following commands:

make tests-zemu

To run a specific test first, please run the following commands:

cd tests_zemu
npm run test -- -t "{testCaseName}"