Skip to content

Commit

Permalink
Merge remote-tracking branch 'stencil/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dfordivam committed Dec 24, 2024
2 parents 1a1535a + 1c7e589 commit 5ae7752
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 1,878 deletions.
3 changes: 0 additions & 3 deletions .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@ rustflags = [
"-C", "save-temps", # Fixes incremental builds by keeping .bc and .ll files
"-C", "embed-bitcode",
]
runner = "./speculos-wrapper -m nanosp "

[target.nanos]
rustflags = [
"-C", "codegen-units=1",
"-C", "save-temps", # Fixes incremental builds by keeping .bc and .ll files
"-C", "embed-bitcode",
]
runner = "./speculos-wrapper -m nanos "

[target.nanox]
rustflags = [
"-C", "codegen-units=1",
"-C", "save-temps", # Fixes incremental builds by keeping .bc and .ll files
"-C", "embed-bitcode",
]
runner = "./speculos-wrapper -m nanox "

[alias]
tt = "test --features extra_debug"
Expand Down
17 changes: 8 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ These dependencies are needed:

Additionally for testing these are needed:

- Node
- Yarn
- Python3
- [Speculos] the official Ledger emulator
- Ragger, a library to run tests on Speculos emulator

[Speculos]: https://github.com/ledgerHQ/speculos

Expand All @@ -27,12 +27,13 @@ The easiest way to get all these dependencies is with Nix:
```bash
nix-shell -A $DEVICE.rustShell
cd rust-app/
cargo ledger build -l $DEVICE
cargo build --release --target=$TARGET_JSON
````
where `DEVICE` is one of
- `nanos` for Nano S
- `nanox` for Nano X
- `nanosplus` for Nano S+
- `flex`, for Flex
- `stax`, for Stax

### Getting a development environment without Nix

Expand All @@ -54,12 +55,10 @@ in order to regenerate this file and keep it up to date.
## Running automated tests with Speculos
Using Nix, from the root level of this repo, run:
Using Nix, from the root level of this repo, run the following script to run tests for all devices
```bash
nix-shell -A $DEVICE.rustShell
cd rust-app/
cargo test --target=$TARGET_JSON
./run-ragger-tests.sh
```

## Deploying development builds to real hardware
Expand All @@ -70,7 +69,7 @@ Nix will always track the latest changes, freshly rebuilding components as neede
That said, it is also possible to use Cargo build.
This useful for the quickest "debug loop".

The [cargo-ledger](https://github.com/LedgerHQ/cargo-ledger.git) builds, outputs a `hex` file and a manifest file for `ledgerctl`, and loads it on a device in a single `cargo-ledger ledger -l nanos` command in the rust-app folder within app directory.
The [cargo-ledger](https://github.com/LedgerHQ/cargo-ledger.git) builds, outputs a `hex` file and a manifest file for `ledgerctl`, and loads it on a device in a single `cargo-ledger ledger -l nanosplus` command in the rust-app folder within app directory.

(You do not need to install `cargo-ledger` if you are using the nix-provided development shell, as it provides it.)

Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ Written using [Alamgu](https://github.com/alamgu/).
## Device Compatability

This application is compatible with
- Ledger Nano S, running firmware 2.1.0 and above
- Ledger Nano S+, running firmware 1.1.0
- Ledger Nano S+
- Ledger Nano X
- Ledger Flex
- Ledger Stax

Note: Compatibility with Ledger Nano X is only possible to check on [Speculos](https://github.com/ledgerHQ/speculos/) emulator,
because the Nano X does not support side-loading apps under development.
Expand Down Expand Up @@ -74,9 +75,10 @@ Finally, run the following command to load the app on your device:
nix --extra-experimental-features nix-command run -f . $DEVICE.loadApp
```
where `DEVICE` is one of
- `nanos`, for Nano S
- `nanox`, for Nano X
- `nanosplus`, for Nano S+
- `flex`, for Flex
- `stax`, for Stax

The app will be downloaded (if you have our Nix cache enabled) and/or freshly built as needed.

Expand All @@ -97,9 +99,10 @@ To build one, run:
nix-build -A $DEVICE.tarball
```
where `DEVICE` is one of
- `nanos`, for Nano S
- `nanox`, for Nano X
- `nanosplus`, for Nano S+
- `flex`, for Flex
- `stax`, for Stax

The last line printed out will be the path of the tarball.

Expand Down Expand Up @@ -141,9 +144,10 @@ To use this tool using Nix, from the root level of this repo, run this command t
nix-shell -A $DEVICE.appShell
```
where `DEVICE` is one of
- `nanos`, for Nano S
- `nanox`, for Nano X
- `nanosplus`, for Nano S+
- `flex`, for Flex
- `stax`, for Stax

Then, one can use `generic-cli` like this:

Expand Down
4 changes: 2 additions & 2 deletions dep/alamgu/github.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"repo": "alamgu",
"branch": "develop",
"private": false,
"rev": "dc11f93df7ef11dc584ca6d14812771a4825435e",
"sha256": "1lhcfiah0r22bc0ry1h9lnrmdapkdhgxjrsy3w3720qj6hy1rdfz"
"rev": "3473d872bf3233fc8f56af230e07afa7613299ad",
"sha256": "1vlknxdz43kjbhingq15j9anmd7jhi11in5wqi18xngv2fahyq2r"
}
2 changes: 1 addition & 1 deletion rust-app/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions rust-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ path = ["44'/784'"]
curve = ["ed25519"]
flags = "0"

[package.metadata.ledger.nanos]
icon = "sui.gif"

[package.metadata.ledger.nanox]
icon = "sui-small.gif"

Expand All @@ -71,4 +68,4 @@ icon = "sui-small.gif"
icon = "sui_32x32.gif"

[package.metadata.ledger.flex]
icon = "sui_40x40.gif"
icon = "sui_40x40.gif"
21 changes: 0 additions & 21 deletions rust-app/tests/ts-tests.rs

This file was deleted.

40 changes: 0 additions & 40 deletions speculos-wrapper

This file was deleted.

1 change: 0 additions & 1 deletion ts-tests/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions ts-tests/.mocharc.js

This file was deleted.

59 changes: 0 additions & 59 deletions ts-tests/Sui.ts

This file was deleted.

Loading

0 comments on commit 5ae7752

Please sign in to comment.