Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .github/actions/install-sim/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ runs:
git config --global user.name "ci"
pushd test/work; git clone --recursive https://github.com/Coldcard/firmware.git; popd
tar -xvf coldcard-mpy.tar.gz
pushd test/work/firmware; git am ../../data/coldcard-multisig.patch; popd
poetry run pip install -r test/work/firmware/requirements.txt
pip install -r test/work/firmware/requirements.txt

Expand Down
1 change: 0 additions & 1 deletion ci/cirrus.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ RUN protoc --version
## Set up environments first to take advantage of layer caching
#RUN mkdir test
#COPY test/setup_environment.sh test/setup_environment.sh
#COPY test/data/coldcard-multisig.patch test/data/coldcard-multisig.patch
## One by one to allow for intermediate caching of successful builds
#RUN cd test; ./setup_environment.sh --trezor-1
#RUN cd test; ./setup_environment.sh --trezor-t
Expand Down
25 changes: 17 additions & 8 deletions hwilib/devices/coldcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,23 @@ def sign_tx(self, tx: PSBT) -> PSBT:

# For multisigs, we may need to do multiple passes if we appear in an input multiple times
passes = 1
for psbt_in in tx.inputs:
our_keys = 0
for key in psbt_in.hd_keypaths.keys():
keypath = psbt_in.hd_keypaths[key]
if keypath.fingerprint == master_fp and key not in psbt_in.partial_sigs:
our_keys += 1
if our_keys > passes:
passes = our_keys

ver = None
try:
ver = self.device.send_recv(CCProtocolPacker.version())
except: pass
if not ver or ("X" not in ver.split("\n")[1]):
# is not EDGE firmware, to sign multiple keys
# from same origin, signing must be repeated
# EDGE can sign all in one sitting
for psbt_in in tx.inputs:
our_keys = 0
for key in psbt_in.hd_keypaths.keys():
keypath = psbt_in.hd_keypaths[key]
if keypath.fingerprint == master_fp and key not in psbt_in.partial_sigs:
our_keys += 1
if our_keys > passes:
passes = our_keys

for _ in range(passes):
# Get psbt in hex and then make binary
Expand Down
2 changes: 0 additions & 2 deletions test/setup_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ if [[ -n ${build_coldcard} ]]; then
coldcard_setup_needed=true
fi
fi
# Apply patch to make simulator work in linux environments
git am ../../data/coldcard-multisig.patch

# Build the simulator. This is cached, but it is also fast
poetry run pip install -r requirements.txt
Expand Down
Loading