Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a52d82e
Add ledger signer
OBorce Jul 23, 2025
f529d10
fix ledger tests
OBorce Aug 22, 2025
3debc9e
ledger cleanup
OBorce Aug 25, 2025
304ad2a
Remove podman usage from Ledger tests, fix comments
OBorce Sep 22, 2025
436fc3d
Use the new ledger messages
OBorce Oct 22, 2025
d1ff8a3
Add Ledger signer provider
OBorce Jul 31, 2025
b935ad1
Add ledger support in CLI and GUI wallet
OBorce Aug 5, 2025
c101537
Add ledger CI tests
OBorce Nov 6, 2025
453d5c2
fix comments
OBorce Nov 11, 2025
e3ee1d7
Fix comments
OBorce Nov 13, 2025
d45302a
Add support for Flex and Stax Ledger emulator tests
OBorce Nov 19, 2025
d1b3334
Use new ledger messages
OBorce Dec 19, 2025
8f71f49
fix comments
OBorce Jan 5, 2026
041b445
bump ml_primitives and add more tests
OBorce Dec 5, 2025
6683ff5
use primitive conversions
OBorce Jan 11, 2026
8acdd20
fix missed comments
OBorce Jan 12, 2026
5458b40
update ledger lib fork
OBorce Jan 14, 2026
d1fcb6a
fix after rebase
OBorce Jan 15, 2026
8b1d8d6
Fix comments
OBorce Feb 6, 2026
6f54e52
Check wallet type for software signer
OBorce Feb 11, 2026
9d89d11
update CHANGELOG
OBorce Feb 11, 2026
775b3e2
update cargo vet
OBorce Feb 11, 2026
9659d69
fix after rebase
OBorce Feb 12, 2026
1341877
Update CHANGELOG for mempool notifications PR
OBorce Feb 12, 2026
f8843fb
cargo vet: add Frank Denis and Hayden Stainsby as trusted publishers;…
ImplOfAnImpl Feb 11, 2026
9296374
cargo vet: regenerate exemptions
ImplOfAnImpl Feb 11, 2026
56e5941
reformat deny.toml to remove trailing whites
OBorce Feb 13, 2026
454a059
Merge pull request #2011 from mintlayer/fix_cargo_vet_for_ledger_sign…
OBorce Feb 20, 2026
9800cfb
fix generic test spending more tokens than available
OBorce Feb 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
174 changes: 144 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- "**" # target all branches
schedule:
- cron: '15 0 * * *' # every day at 00:15 UTC
- cron: "15 0 * * *" # every day at 00:15 UTC

env:
CARGO_TERM_COLOR: always
Expand All @@ -27,7 +27,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: './build-tools/.python-version'
python-version-file: "./build-tools/.python-version"

- name: Install Rust
# Use bash to be able to escape the newline via '\'.
Expand All @@ -37,17 +37,17 @@ jobs:
--default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version)

- name: Build
run: cargo build --release --locked --features trezor
run: cargo build --release --locked --features trezor,ledger

- name: Run tests
run: cargo test --release --workspace --features trezor
run: cargo test --release --workspace --features trezor,ledger

- name: Run doc tests
run: cargo test --release --doc --features trezor
run: cargo test --release --doc --features trezor,ledger

# This test is ignored, so it needs to run separately.
- name: Run mixed_sighash_types test
run: cargo test --release mixed_sighash_types --features trezor
run: cargo test --release mixed_sighash_types --features trezor,ledger

# This test is ignored, so it needs to run separately.
- name: Run test_4opc_sequences test
Expand Down Expand Up @@ -76,30 +76,30 @@ jobs:
run: sudo apt-get update

- name: Install build dependencies
run: sudo apt-get install -yqq --no-install-recommends build-essential podman pkg-config libssl-dev
run: sudo apt-get install -yqq --no-install-recommends build-essential podman pkg-config libssl-dev libdbus-1-dev libusb-1.0-0-dev

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: './build-tools/.python-version'
python-version-file: "./build-tools/.python-version"

- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
--default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version)

- name: Build
run: cargo build --release --locked --features trezor
run: cargo build --release --locked --features trezor,ledger

- name: Run tests
run: cargo test --release --workspace --features trezor
run: cargo test --release --workspace --features trezor,ledger

- name: Run doc tests
run: cargo test --release --doc --features trezor
run: cargo test --release --doc --features trezor,ledger

# This test is ignored, so it needs to run separately.
- name: Run mixed_sighash_types test
run: cargo test --release mixed_sighash_types --features trezor
run: cargo test --release mixed_sighash_types --features trezor,ledger

# This test is ignored, so it needs to run separately.
- name: Run test_4opc_sequences test
Expand All @@ -125,25 +125,25 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: './build-tools/.python-version'
python-version-file: "./build-tools/.python-version"

- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
--default-toolchain $(python ./build-tools/cargo-info-extractor/extract.py --rust-version)

- name: Build
run: cargo build --release --locked --features trezor
run: cargo build --release --locked --features trezor,ledger

- name: Run tests
run: cargo test --release --workspace --features trezor
run: cargo test --release --workspace --features trezor,ledger

- name: Run doc tests
run: cargo test --release --doc --features trezor
run: cargo test --release --doc --features trezor,ledger

# This test is ignored, so it needs to run separately.
- name: Run mixed_sighash_types test
run: cargo test --release mixed_sighash_types --features trezor
run: cargo test --release mixed_sighash_types --features trezor,ledger

# This test is ignored, so it needs to run separately.
- name: Run test_4opc_sequences test
Expand All @@ -162,9 +162,9 @@ jobs:
run_tests_on_trezor_preparation:
runs-on: ubuntu-latest
steps:
# Note: we need to mimic the directory structure of the run_tests_on_trezor job, otherwise nextest
# will fail to execute archived tests. So we checkout the source code to "./mintlayer-core".
# (Also note that because of this the resulting path of the source dir will be "/.../mintlayer-core/mintlayer-core/mintlayer-core")
# Note: we need to mimic the directory structure of the run_tests_on_trezor job, otherwise nextest
# will fail to execute archived tests. So we checkout the source code to "./mintlayer-core".
# (Also note that because of this the resulting path of the source dir will be "/.../mintlayer-core/mintlayer-core/mintlayer-core")
- name: Checkout the core repository
uses: actions/checkout@v5
with:
Expand All @@ -175,12 +175,12 @@ jobs:
run: sudo apt-get update

- name: Install build dependencies
run: sudo apt-get install -yqq --no-install-recommends build-essential pkg-config libssl-dev
run: sudo apt-get install -yqq --no-install-recommends build-essential pkg-config libssl-dev libdbus-1-dev libusb-1.0-0-dev

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: './mintlayer-core/build-tools/.python-version'
python-version-file: "./mintlayer-core/build-tools/.python-version"

- name: Extract required info from Cargo.toml
id: extract_cargo_info
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: './mintlayer-core/build-tools/.python-version'
python-version-file: "./mintlayer-core/build-tools/.python-version"

- name: Extract required info from Cargo.toml
id: extract_cargo_info
Expand Down Expand Up @@ -281,13 +281,127 @@ jobs:
# Note: since we haven't installed Cargo in this job, we have to execute "cargo-nextest nextest"
# instead of "cargo nextest".
- name: Run tests in the emulator
run:
nix-shell --run "
poetry run core/emu.py
--headless --quiet --temporary-profile
--mnemonic \"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about\"
--command env --chdir ../mintlayer-core
cargo-nextest nextest run --archive-file tests.tar.zst -j1 trezor_signer
run: nix-shell --run "
poetry run core/emu.py
--headless --quiet --temporary-profile
--mnemonic \"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about\"
--command env --chdir ../mintlayer-core
cargo-nextest nextest run --archive-file tests.tar.zst -j1 trezor_signer
"
working-directory: ./mintlayer-trezor-firmware
timeout-minutes: 10

# Build Ledger-specific tests and archive them
run_tests_on_ledger_preparation:
runs-on: ubuntu-latest
steps:
- name: Checkout the core repository
uses: actions/checkout@v5
with:
submodules: recursive
path: ./mintlayer-core

- name: Update the list of available system packages
run: sudo apt-get update
Comment on lines 303 to 305
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Update the list of available system packages"


- name: Install build dependencies
run: sudo apt-get install -yqq --no-install-recommends build-essential pkg-config libdbus-1-dev libusb-1.0-0-dev

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: "./mintlayer-core/build-tools/.python-version"

- name: Extract required info from Cargo.toml
id: extract_cargo_info
run: echo "RUST_VERSION=$(python ./build-tools/cargo-info-extractor/extract.py --rust-version)" >> $GITHUB_OUTPUT
working-directory: ./mintlayer-core

- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
--default-toolchain ${{ steps.extract_cargo_info.outputs.RUST_VERSION }}

- name: Install cargo-nextest
uses: taiki-e/install-action@nextest

- name: Build and archive the tests
run: cargo nextest archive --release --locked -p wallet --features enable-ledger-device-tests --archive-file ledger-tests.tar.zst
working-directory: ./mintlayer-core

- name: Upload archived tests
uses: actions/upload-artifact@v4
with:
name: archived-ledger-tests
path: ./mintlayer-core/ledger-tests.tar.zst
retention-days: 1

# Run Ledger-specific tests on an emulator
run_tests_on_ledger:
needs: run_tests_on_ledger_preparation
runs-on: ubuntu-latest
strategy:
matrix:
model: [apex_p, flex, stax, nanox, nanosplus]
env:
LEDGER_TESTS_AUTO_CONFIRM: true
steps:
- name: Checkout the core repository
uses: actions/checkout@v5
with:
submodules: recursive
path: ./mintlayer-core

- name: Checkout mintlayer-ledger-app repository
uses: actions/checkout@v5
with:
repository: mintlayer/mintlayer-ledger-app
ref: feature/mintlayer-app
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plz don't forget to update this

path: ./mintlayer-ledger-app

- name: Download archived tests
uses: actions/download-artifact@v4
with:
name: archived-ledger-tests
path: ./mintlayer-core

- name: Install cargo-nextest
uses: taiki-e/install-action@nextest

- name: Build Ledger app in container
run: |
sudo docker run --rm \
-v "$(realpath ./mintlayer-ledger-app):/app" \
ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest \
sh -c 'cargo ledger build ${{ matrix.model }}'

- name: Run Ledger emulator and execute tests
run: |
set -e

sudo docker run -d --rm --name ledger-emulator \
-v "$(realpath ./mintlayer-ledger-app):/app" \
--publish 5000:5000 --publish 9999:9999 \
ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest \
sh -c 'speculos --apdu-port 9999 --api-port 5000 --display headless \
-s "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about" \
target/${{ matrix.model }}/release/mintlayer-app'

echo "--- Waiting for emulator to initialize ---"
sleep 15

# Set up a trap to ensure the container is stopped even if tests fail or the job is cancelled
trap "echo '--- Dumping Ledger emulator logs ---'; \
sudo docker logs ledger-emulator; \
echo '--- Stopping Ledger emulator ---'; \
sudo docker stop ledger-emulator" \
EXIT

echo "--- Running Ledger device tests on the host ---"
cd ./mintlayer-core

# Export the device model from the matrix so the Rust test can pick it up
export LEDGER_TESTS_DEVICE_MODEL=${{ matrix.model }}

cargo-nextest nextest run --archive-file ledger-tests.tar.zst -j1 ledger_signer
timeout-minutes: 15
10 changes: 5 additions & 5 deletions .github/workflows/code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- "**" # target all branches
schedule:
- cron: '15 0 * * *' # every day at 00:15 UTC
- cron: "15 0 * * *" # every day at 00:15 UTC

env:
CARGO_TERM_COLOR: always
Expand All @@ -28,12 +28,12 @@ jobs:
run: sudo apt-get update

- name: Install build dependencies
run: sudo apt-get install -yqq --no-install-recommends build-essential
run: sudo apt-get install -yqq --no-install-recommends build-essential libdbus-1-dev libusb-1.0-0-dev

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: './build-tools/.python-version'
python-version-file: "./build-tools/.python-version"

- name: Install Rust
run: |
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: './build-tools/.python-version'
python-version-file: "./build-tools/.python-version"

- name: Install Rust
# Use bash to be able to escape the newline via '\'.
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version-file: './build-tools/.python-version'
python-version-file: "./build-tools/.python-version"

- name: Install Rust
run: |
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@ The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/

- Wallet RPC:
- new methods added: `node_get_tokens_info`, `order_list_own`, `order_list_all_active`.
- new value `ledger` in the `hardware_wallet` option for `wallet_create`, `wallet_recover` and `wallet_open` methods.

- Wallet CLI:
- the commands `order-create`, `order-fill`, `order-freeze`, `order-conclude` were added,
mirroring their existing RPC counterparts;
- other new commands added: `order-list-own`, `order-list-all-active`;
- `wallet-create`/`wallet-recover`/`wallet-open` support the `ledger` subcommand, in addition to the existing
`software` and `trezor`, which specifies the type of the wallet to operate on.

- Wallet:
- Added support for Ledger hardware wallets (beta).
- Now the wallet subscribes to events from the Mempool to include not yet confirmed transactions
relevant to this wallet.

### Changed
- Wallet RPC:
Expand Down
Loading