Skip to content

Commit 2ea8b78

Browse files
committed
Merge #818: Pin device repos
cafc8b0 ci, bitbox02: stop simulator after timeout (Sjors Provoost) 38fae57 Constrain cbor2 to <5.8 (Sjors Provoost) 51e55a1 test, bitbox02: add 5 minute startup timeout (Sjors Provoost) 85d98b2 test, jade: add 5 minute startup timeout (Sjors Provoost) 27f59da ci, jade: pin to v1.0.36 (Sjors Provoost) ba35c93 ci, coldcard: pin to v5.4.4 (Sjors Provoost) 511e019 ci, ledger: Pin Ledger app versions for compatibility (Sjors Provoost) cab1a9a ci: Pin device firmware versions in setup_environment.sh (Sjors Provoost) d25cc7d test: assert getkeypool returns list before passing to importdescriptors (Sjors Provoost) 3d140ec test, coldcard: Disable external input tests (Ava Chow) 613fe84 ci: install some more dependencies (Ava Chow) 2491a38 test, coldcard: Apply mpy patch before building (Ava Chow) 9ba9a17 test, ledger: Update automation (Ava Chow) 1d09f40 test, ledger: Install speculos dependencies from speculos (Ava Chow) 5331398 test, keepkey: Patch nanopb deprecated file mode (Ava Chow) c6c5559 ci, test: Use shallow clones for device firmware repos (Ava Chow) d4f1873 ci: Use github mirror of lwip (Ava Chow) 54b8869 ci, ledger: Build Bitcoin Legacy app and use nanosp for testing it (Ava Chow) 18b747e ci: Fix dist tests (Ava Chow) 8e63078 ci: Stop using ubuntu-22.04 (Ava Chow) 09080f2 test, trezor: Patch Trezor T to build (Ava Chow) 11ade3a test, trezor: Change to uv (Ava Chow) c070643 test, coldcard: Update multisig patch (Ava Chow) Pull request description: Time to stop the whack-a-mole game. Pin firmware and simulator versions to the latest releases known to work. We or the device makers can bump them as needed. This approach seems more suitable for the lower pace of development on this repo. Superseedes #812 (takes most of its commits) ACKs for top commit: achow101: ACK cafc8b0 Tree-SHA512: b6646cddc2a6c8fd68956aba1d35343fc4ef9531aee4b4fdc7668c74d559467cd113121b5b17f9cff6519f2491da7fe32057534e2a9dccd901257ec6c715f5bb
2 parents 4e342db + cafc8b0 commit 2ea8b78

19 files changed

+274
-104
lines changed

.github/actions/build-sim/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ runs:
1717
shell: bash
1818
run: |
1919
sudo apt-get update
20-
sudo apt-get install -y gcc-arm-linux-gnueabihf libsdl2-image-dev libslirp-dev libpcsclite-dev ninja-build
21-
pip install poetry
20+
sudo apt-get install -y gcc-arm-linux-gnueabihf libsdl2-image-dev libslirp-dev libpcsclite-dev ninja-build libltdl-dev
21+
pip install poetry uv
2222
wget https://github.com/protocolbuffers/protobuf/releases/download/v22.0/protoc-22.0-linux-x86_64.zip
2323
sudo unzip protoc-22.0-linux-x86_64.zip -d /usr/local
2424
protoc --version
@@ -30,6 +30,9 @@ runs:
3030
git config --global user.email 'ci@ci.com'
3131
git config --global user.name 'ci'
3232
git config --global --add safe.directory "$GITHUB_WORKSPACE"
33+
# Rewrite lwip URLs to github mirror to avoid stalling issue
34+
git config --global --add url."https://github.com/lwip-tcpip/lwip.git".insteadOf "https://git.savannah.gnu.org/r/lwip.git"
35+
git config --global --add url."https://github.com/lwip-tcpip/lwip.git".insteadOf "https://git.savannah.nongnu.org/git/lwip.git"
3336
cd test
3437
./setup_environment.sh --"${{ inputs.name }}"
3538
cd ..

.github/actions/install-sim/action.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ runs:
2020
2121
- if: inputs.device == 'coldcard'
2222
shell: bash
23+
env:
24+
# Keep in sync with test/setup_environment.sh
25+
COLDCARD_VERSION: "2025-09-30T1238-v5.4.4"
2326
run: |
2427
apt-get update
2528
apt-get install -y libpcsclite-dev libusb-1.0-0 swig
2629
git config --global user.email "ci@ci.com"
2730
git config --global user.name "ci"
28-
pushd test/work; git clone --recursive https://github.com/Coldcard/firmware.git; popd
31+
# Note: cannot use --shallow-submodules because lwip submodule on git.savannah.gnu.org doesn't support it
32+
pushd test/work; git clone --recursive --depth 1 --branch ${COLDCARD_VERSION} https://github.com/Coldcard/firmware.git; popd
2933
tar -xvf coldcard-mpy.tar.gz
3034
pushd test/work/firmware; git am ../../data/coldcard-multisig.patch; popd
3135
poetry run pip install -r test/work/firmware/requirements.txt
@@ -60,20 +64,25 @@ runs:
6064
apt-get update
6165
apt-get install -y libusb-1.0-0 qemu-user-static
6266
tar -xvf speculos.tar.gz
63-
poetry run pip install construct flask-cors flask-restful jsonschema ledgered mnemonic pyelftools pillow requests pytesseract
64-
pip install construct flask-cors flask-restful jsonschema ledgered mnemonic pyelftools pillow requests pytesseract
67+
poetry run pip install -e test/work/speculos
68+
pip install -e test/work/speculos
6569
66-
- if: inputs.device == 'ledger'
70+
- if: startsWith(inputs.device, 'ledger')
6771
uses: actions/download-artifact@v4
6872
with:
69-
name: ${{ inputs.device == 'ledger-legacy' && 'ledger_app_nano_s' || 'ledger_app_nano_x' }}
73+
name: ${{ inputs.device == 'ledger-legacy' && 'ledger_app_legacy' || 'ledger_app' }}
7074

7175

7276
- if: inputs.device == 'ledger'
7377
shell: bash
7478
run: |
7579
mv app.elf test/work/speculos/apps/btc-test.elf
7680
81+
- if: inputs.device == 'ledger-legacy'
82+
shell: bash
83+
run: |
84+
mv app.elf test/work/speculos/apps/btc-test-legacy.elf
85+
7786
- if: inputs.device == 'keepkey'
7887
shell: bash
7988
run: |

.github/actions/test-dist/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ runs:
4646
if: matrix.test.script == 'Wheel'
4747
shell: bash
4848
run: |
49-
cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..
49+
cd test; ./run_tests.py --${{ matrix.device }} --interface=cli --device-only; cd ..
5050
5151
- name: Run tests (Sdist)
5252
if: matrix.test.script == 'Sdist'
5353
shell: bash
5454
run: |
55-
cd test; ./run_tests.py $DEVICE --interface=cli --device-only; cd ..
55+
cd test; ./run_tests.py --${{ matrix.device }} --interface=cli --device-only; cd ..
5656
5757
- name: Run tests (Bindist)
5858
if: matrix.test.script == 'Bindist'
5959
shell: bash
6060
run: |
61-
cd test; poetry run ./run_tests.py $DEVICE --interface=bindist --device-only; cd ..
61+
cd test; poetry run ./run_tests.py --${{ matrix.device }} --interface=bindist --device-only; cd ..
6262
6363
- if: failure()
6464
shell: bash

.github/workflows/ci.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,7 @@ jobs:
114114
with:
115115
sim: trezor
116116
include: ${{ needs.prepare-sim-matrices.outputs.trezor }}
117-
# Ubuntu 22.04 ships with glibc 2.35, which is needed to keep Trezor 1
118-
# binaries compatible with Debian Bookworm (glibc 2.36) Python containers.
119-
# Trezor T binaries don't need this.
120-
runs-on: ubuntu-22.04
117+
runs-on: ubuntu-latest
121118

122119
sim-builder-coldcard:
123120
name: Coldcard sim builder
@@ -126,7 +123,7 @@ jobs:
126123
with:
127124
sim: coldcard
128125
include: ${{ needs.prepare-sim-matrices.outputs.coldcard }}
129-
runs-on: ubuntu-22.04
126+
runs-on: ubuntu-latest
130127

131128
sim-builder-bitbox:
132129
name: Bitbox sim builder
@@ -162,27 +159,23 @@ jobs:
162159
with:
163160
sim: keepkey
164161
include: ${{ needs.prepare-sim-matrices.outputs.keepkey }}
165-
runs-on: ubuntu-22.04
162+
runs-on: ubuntu-latest
166163

167-
ledger-s-app-builder:
168-
name: Ledger Nano S Bitcoin App builder
169-
uses: ./.github/workflows/ledger-app-builder.yml
164+
ledger-legacy-app-builder:
165+
name: Ledger Bitcoin Legacy App builder
166+
uses: ./.github/workflows/ledger-legacy-app-builder.yml
170167
with:
171-
app: nano_s
172168
runs-on: ubuntu-latest
173169

174-
ledger-x-app-builder:
175-
name: Ledger Nano X Bitcoin App builder
170+
ledger-app-builder:
171+
name: Ledger Bitcoin App builder
176172
uses: ./.github/workflows/ledger-app-builder.yml
177173
with:
178-
app: nano_x
179174
runs-on: ubuntu-latest
180175

181176
bitcoind-builder:
182177
name: bitcoind builder
183-
# Ubuntu 22.04 ships with glibc 2.35, which is needed to keep binaries
184-
# compatible with Debian Bookworm (glibc 2.36) Python containers.
185-
runs-on: ubuntu-22.04
178+
runs-on: ubuntu-latest
186179
steps:
187180
- uses: actions/checkout@v4
188181
- uses: ./.github/actions/build-bitcoind
@@ -201,16 +194,16 @@ jobs:
201194
device: trezor-t
202195
runs-on: ubuntu-latest
203196

204-
test-ledger-s:
197+
test-ledger-legacy:
205198
uses: ./.github/workflows/device-test.yml
206-
needs: [sim-builder-ledger, ledger-s-app-builder, bitcoind-builder, dist-builder]
199+
needs: [sim-builder-ledger, ledger-legacy-app-builder, bitcoind-builder, dist-builder]
207200
with:
208201
device: ledger-legacy
209202
runs-on: ubuntu-latest
210203

211-
test-ledger-x:
204+
test-ledger:
212205
uses: ./.github/workflows/device-test.yml
213-
needs: [sim-builder-ledger, ledger-x-app-builder, bitcoind-builder, dist-builder]
206+
needs: [sim-builder-ledger, ledger-app-builder, bitcoind-builder, dist-builder]
214207
with:
215208
device: ledger
216209
runs-on: ubuntu-latest
@@ -220,7 +213,7 @@ jobs:
220213
needs: [sim-builder-coldcard, bitcoind-builder, dist-builder]
221214
with:
222215
device: coldcard
223-
runs-on: ubuntu-22.04
216+
runs-on: ubuntu-latest
224217

225218
test-bitbox01:
226219
uses: ./.github/workflows/device-test.yml
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
name: Ledger App Builder
1+
name: Ledger Nano X App Builder
22
on:
33
workflow_call:
44
inputs:
5-
app:
6-
required: true # 'nano_s' or 'nano_x'
7-
type: string
85
runs-on:
96
required: false
107
type: string
118
default: ubuntu-latest
129

1310
jobs:
1411
build:
15-
name: Build ${{ inputs.app }}
12+
name: Build Bitcoin App
1613
runs-on: ${{ inputs.runs-on }}
17-
container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
14+
# Pin to 4.23.0 for SDK v25.9.0 compatibility with Speculos v0.25.10
15+
container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:4.23.0
1816
steps:
1917
- run: |
20-
git clone https://github.com/LedgerHQ/app-bitcoin-new.git
18+
# Pin to v2.4.1 - last version that worked with HWI CI (PR #795 merged Sept 2025)
19+
git clone --branch 2.4.1 --depth 1 https://github.com/LedgerHQ/app-bitcoin-new.git
2120
cd app-bitcoin-new
22-
make DEBUG=1 ${{ inputs.app == 'nano_x' && 'BOLOS_SDK=$NANOX_SDK' || '' }}
21+
make DEBUG=1 BOLOS_SDK=$NANOX_SDK
2322
- uses: actions/upload-artifact@v4
2423
with:
25-
name: ${{ inputs.app == 'nano_x' && 'ledger_app_nano_x' || 'ledger_app_nano_s' }}
24+
name: ledger_app
2625
path: app-bitcoin-new/bin/app.elf
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Ledger App Builder
2+
on:
3+
workflow_call:
4+
inputs:
5+
runs-on:
6+
required: false
7+
type: string
8+
default: ubuntu-latest
9+
10+
jobs:
11+
build:
12+
name: Build Bitcoin Legacy App
13+
runs-on: ${{ inputs.runs-on }}
14+
# Pin to 4.23.0 for SDK v25.9.0 compatibility with Speculos v0.25.10
15+
container: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:4.23.0
16+
steps:
17+
- run: |
18+
# Pin to legacy-1.6.6 HEAD commit for reproducibility
19+
git clone --depth 1 https://github.com/LedgerHQ/app-bitcoin.git -b legacy-1.6.6
20+
cd app-bitcoin
21+
make DEBUG=1 BOLOS_SDK=$NANOSP_SDK
22+
- uses: actions/upload-artifact@v4
23+
with:
24+
name: ledger_app_legacy
25+
path: app-bitcoin/bin/app.elf

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mnemonic = "~0"
2424
typing-extensions = "^4.4"
2525
libusb1 = ">=1.7,<4"
2626
pyside2 = { version = "^5.14.0", optional = true, python = "<3.10" }
27-
cbor2 = "^5.4.6"
27+
cbor2 = ">=5.4.6,<5.8"
2828
pyserial = "^3.5"
2929
dataclasses = {version = "^0.8", python = ">=3.6,<3.7"}
3030
semver = "^3.0.1"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
modules = \
2727
['hwi', 'hwi-qt']
2828
install_requires = \
29-
['cbor2>=5.4.6,<6.0.0',
29+
['cbor2>=5.4.6,<5.8',
3030
'ecdsa>=0,<1',
3131
'hidapi>=0.14.0',
3232
'libusb1>=1.7,<4',

test/data/coldcard-multisig.patch

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From fd51e85693e0d66129133b1f195134aead1cf7d0 Mon Sep 17 00:00:00 2001
2-
From: Andrew Chow <achow101-github@achow101.com>
3-
Date: Tue, 17 Dec 2019 17:56:05 -0500
4-
Subject: [PATCH 2/3] Change default simulator multisig
1+
From 038e4b4f5e8128f3910745324332770b0973408c Mon Sep 17 00:00:00 2001
2+
From: Ava Chow <github@achow101.com>
3+
Date: Wed, 1 Oct 2025 13:30:01 -0700
4+
Subject: [PATCH 1/2] Change default simulator multisig
55

66
---
77
unix/variant/sim_settings.py | 6 +++++-
88
1 file changed, 5 insertions(+), 1 deletion(-)
99

1010
diff --git a/unix/variant/sim_settings.py b/unix/variant/sim_settings.py
11-
index 2706fb4..f9b533d 100644
11+
index 01392d8f..527d0d9b 100644
1212
--- a/unix/variant/sim_settings.py
1313
+++ b/unix/variant/sim_settings.py
1414
@@ -71,7 +71,11 @@ if '--ms' in sys.argv:
@@ -18,27 +18,28 @@ index 2706fb4..f9b533d 100644
1818
- sim_defaults['multisig'] = [['MeMyself', [2, 4], [[3503269483, 'tpubD9429UXFGCTKJ9NdiNK4rC5ygqSUkginycYHccqSg5gkmyQ7PZRHNjk99M6a6Y3NY8ctEUUJvCu6iCCui8Ju3xrHRu3Ez1CKB4ZFoRZDdP9'], [2389277556, 'tpubD97nVL37v5tWyMf9ofh5rznwhh1593WMRg6FT4o6MRJkKWANtwAMHYLrcJFsFmPfYbY1TE1LLQ4KBb84LBPt1ubvFwoosvMkcWJtMwvXgSc'], [3190206587, 'tpubD9ArfXowvGHnuECKdGXVKDMfZVGdephVWg8fWGWStH3VKHzT4ph3A4ZcgXWqFu1F5xGTfxncmrnf3sLC86dup2a8Kx7z3xQ3AgeNTQeFxPa'], [1130956047, 'tpubD8NXmKsmWp3a3DXhbihAYbYLGaRNVdTnr6JoSxxfXYQcmwVtW2hv8QoDwng6JtEonmJoL3cNEwfd2cLXMpGezwZ2vL2dQ7259bueNKj9C8n']], {'ch': 'XTN', 'pp': "45'"}]]
1919
+ sim_defaults['multisig'] = [
2020
+ ['mstest', [2, 3], [[1130956047, 0, 'tpubDF2rnouQaaYrR9x68P5Jm8WjhCE4atyGiPviFA9ve5iMnYbkTjof2HjzejcQcD7getPusDLPsWJLN2UttzK3pyVgBkRs52MiRZM7ZJ8TrEq'], [1130956047, 1, 'tpubDETRnZNJAqXiVeiL8UMDzCTBAoh3JvZkgXLdb1K2xzpJLepuJ6ka8jnVyRSkVh8Nbbo8u8dobZCsNENmRKipLzHNsS5mccjKSpXgSgavTQe'], [1130956047, 2, 'tpubDF3hdPQ5oDhtYjjaC596pboPii7UZmjqZcBPBRAbb6Bgn9hKoFxb8zWsBfdiCnTq3htUs2Yi2reeG3kMqHzZGZykJQAB5aKrJ8UfiXjmaLD']], {'ft': 8, 'ch': 'XTN', "d": ["48'/1'/0'/0'", "48'/1'/1'/0'", "48'/1'/2'/0'"]}],
21-
+ ['mstest1', [2, 3], [[1130956047, 0, 'tpubDF2rnouQaaYrUEy2JM1YD3RFzew4onawGM4X2Re67gguTf5CbHonBRiFGe3Xjz7DK88dxBFGf2i7K1hef3PM4cFKyUjcbJXddaY9F5tJBoP'], [1130956047, 1, 'tpubDETRnZNJAqXiVeiL8UMDzCTBAoh3JvZkgXLdb1K2xzpJLepuJ6ka8jnVyRSkVh8Nbbo8u8dobZCsNENmRKipLzHNsS5mccjKSpXgSgavTQe'], [1130956047, 2, 'tpubDF3hdPQ5oDhtYjjaC596pboPii7UZmjqZcBPBRAbb6Bgn9hKoFxb8zWsBfdiCnTq3htUs2Yi2reeG3kMqHzZGZykJQAB5aKrJ8UfiXjmaLD']], {'ft': 14, 'ch': 'XTN', "d": ["48'/1'/0'/0'", "48'/1'/1'/0'", "48'/1'/2'/0'"]}],
22-
+ ['mstest2', [2, 3], [[1130956047, 0, 'tpubDF2rnouQaaYrXF4noGTv6rQYmx87cQ4GrUdhpvXkhtChwQPbdGTi8GA88NUaSrwZBwNsTkC9bFkkC8vDyGBVVAQTZ2AS6gs68RQXtXcCvkP'], [1130956047, 1, 'tpubDETRnZNJAqXiVeiL8UMDzCTBAoh3JvZkgXLdb1K2xzpJLepuJ6ka8jnVyRSkVh8Nbbo8u8dobZCsNENmRKipLzHNsS5mccjKSpXgSgavTQe'], [1130956047, 2, 'tpubDF3hdPQ5oDhtYjjaC596pboPii7UZmjqZcBPBRAbb6Bgn9hKoFxb8zWsBfdiCnTq3htUs2Yi2reeG3kMqHzZGZykJQAB5aKrJ8UfiXjmaLD']], {'ft': 26, 'ch': 'XTN', "d": ["48'/1'/0'/0'", "48'/1'/1'/0'", "48'/1'/2'/0'"]}],
21+
+ ['mstest1', [2, 3], [[1130956047, 0, 'tpubDF2rnouQaaYrR9x68P5Jm8WjhCE4atyGiPviFA9ve5iMnYbkTjof2HjzejcQcD7getPusDLPsWJLN2UttzK3pyVgBkRs52MiRZM7ZJ8TrEq'], [1130956047, 1, 'tpubDETRnZNJAqXiVeiL8UMDzCTBAoh3JvZkgXLdb1K2xzpJLepuJ6ka8jnVyRSkVh8Nbbo8u8dobZCsNENmRKipLzHNsS5mccjKSpXgSgavTQe'], [1130956047, 2, 'tpubDF3hdPQ5oDhtYjjaC596pboPii7UZmjqZcBPBRAbb6Bgn9hKoFxb8zWsBfdiCnTq3htUs2Yi2reeG3kMqHzZGZykJQAB5aKrJ8UfiXjmaLD']], {'ft': 14, 'ch': 'XTN', "d": ["48'/1'/0'/0'", "48'/1'/1'/0'", "48'/1'/2'/0'"]}],
22+
+ ['mstest2', [2, 3], [[1130956047, 0, 'tpubDF2rnouQaaYrR9x68P5Jm8WjhCE4atyGiPviFA9ve5iMnYbkTjof2HjzejcQcD7getPusDLPsWJLN2UttzK3pyVgBkRs52MiRZM7ZJ8TrEq'], [1130956047, 1, 'tpubDETRnZNJAqXiVeiL8UMDzCTBAoh3JvZkgXLdb1K2xzpJLepuJ6ka8jnVyRSkVh8Nbbo8u8dobZCsNENmRKipLzHNsS5mccjKSpXgSgavTQe'], [1130956047, 2, 'tpubDF3hdPQ5oDhtYjjaC596pboPii7UZmjqZcBPBRAbb6Bgn9hKoFxb8zWsBfdiCnTq3htUs2Yi2reeG3kMqHzZGZykJQAB5aKrJ8UfiXjmaLD']], {'ft': 26, 'ch': 'XTN', "d": ["48'/1'/0'/0'", "48'/1'/1'/0'", "48'/1'/2'/0'"]}],
2323
+ ]
2424
sim_defaults['fee_limit'] = -1
2525

2626
if '--xfp' in sys.argv:
2727
--
28-
2.38.1
28+
2.51.0
2929

30-
From 8b4323c1e393d79d46248dd822ca9aaaeb2b2bc3 Mon Sep 17 00:00:00 2001
30+
31+
From 3f7b6dfcf72788a4a0784eb871462c289e8a747b Mon Sep 17 00:00:00 2001
3132
From: Sjors Provoost <sjors@sprovoost.nl>
3233
Date: Wed, 23 Jul 2025 10:16:22 +0200
33-
Subject: [PATCH] Allow multisigs to share master fingerprint
34+
Subject: [PATCH 2/2] Allow multisigs to share master fingerprint
3435

3536
Co-Authored-By: Ava Chow <github@achow101.com>
3637
---
37-
shared/multisig.py | 37 ++++++++++++++++++++++++-------------
38-
1 file changed, 24 insertions(+), 13 deletions(-)
38+
shared/multisig.py | 39 ++++++++++++++++++++++++---------------
39+
1 file changed, 24 insertions(+), 15 deletions(-)
3940

4041
diff --git a/shared/multisig.py b/shared/multisig.py
41-
index 446998a2..cabb2003 100644
42+
index 1e692d41..6294e9a3 100644
4243
--- a/shared/multisig.py
4344
+++ b/shared/multisig.py
4445
@@ -144,9 +144,9 @@ class MultisigWallet(WalletABC):
@@ -53,7 +54,7 @@ index 446998a2..cabb2003 100644
5354

5455
@classmethod
5556
def render_addr_fmt(cls, addr_fmt):
56-
@@ -270,7 +270,11 @@ class MultisigWallet(WalletABC):
57+
@@ -275,7 +275,11 @@ class MultisigWallet(WalletABC):
5758

5859
def get_xfp_paths(self):
5960
# return list of lists [xfp, *deriv]
@@ -65,8 +66,8 @@ index 446998a2..cabb2003 100644
6566
+ return ret
6667

6768
@classmethod
68-
def find_match(cls, M, N, xfp_paths, addr_fmt=None):
69-
@@ -305,24 +309,31 @@ class MultisigWallet(WalletABC):
69+
def find_match(cls, M, N, xfp_paths, addr_fmts=None):
70+
@@ -305,24 +309,29 @@ class MultisigWallet(WalletABC):
7071
# the same prefix path per-each xfp, as indicated
7172
# xfp_paths (unordered)?
7273
# - could also check non-prefix part is all non-hardened
@@ -79,35 +80,35 @@ index 446998a2..cabb2003 100644
7980
if x[0] not in self.xfp_paths:
8081
return False
8182
- prefix = self.xfp_paths[x[0]]
83+
-
84+
- if len(x) < len(prefix):
85+
- # PSBT specs a path shorter than wallet's xpub
86+
- #print('path len: %d vs %d' % (len(prefix), len(x)))
87+
- return False
88+
-
89+
- comm = len(prefix)
90+
- if tuple(prefix[:comm]) != tuple(x[:comm]):
91+
- # xfp => maps to wrong path
92+
- #print('path mismatch:\n%r\n%r\ncomm=%d' % (prefix[:comm], x[:comm], comm))
8293
+ for prefix in self.xfp_paths[x[0]]:
8394
+ if len(x) < len(prefix):
8495
+ # PSBT specs a path shorter than wallet's xpub
8596
+ #print('path len: %d vs %d' % (len(prefix), len(x)))
8697
+ return False
87-
88-
- if len(x) < len(prefix):
89-
- # PSBT specs a path shorter than wallet's xpub
90-
- #print('path len: %d vs %d' % (len(prefix), len(x)))
91-
- return False
98+
+
9299
+ comm = len(prefix)
93100
+ if tuple(prefix[:comm]) != tuple(x[:comm]):
94101
+ # xfp => maps to wrong path
95-
+ # But maybe there is another path that does match, so keep going
96102
+ #print('path mismatch:\n%r\n%r\ncomm=%d' % (prefix[:comm], x[:comm], comm))
97103
+ continue
98104
+ else:
99105
+ # Found a match, cleanly exit
100106
+ break
101107
+ else:
102108
+ # No match was found
103-
104-
- comm = len(prefix)
105-
- if tuple(prefix[:comm]) != tuple(x[:comm]):
106-
- # xfp => maps to wrong path
107-
- #print('path mismatch:\n%r\n%r\ncomm=%d' % (prefix[:comm], x[:comm], comm))
108109
return False
109110

110111
return True
111112
--
112-
2.39.5 (Apple Git-154)
113+
2.51.0
113114

0 commit comments

Comments
 (0)