Skip to content

Commit 4e8f3b5

Browse files
committed
ci: exercise the 7.14.3 bitcoin-only product
1 parent ef41fc9 commit 4e8f3b5

4 files changed

Lines changed: 45 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# KeepKey python-keepkey CI
22
#
3-
# Pulls the published emulator image (kktech/kkemu) from DockerHub
4-
# and runs the full python integration test suite against it.
3+
# Builds the 7.14.3 Bitcoin-only emulator from the fork release branch and
4+
# runs the full Python integration suite against that exact product variant.
55
#
66
# Stage 1: GATE (seconds)
77
# └─ lint Python syntax + deterministic protocol contract tests
@@ -66,10 +66,10 @@ jobs:
6666
echo "| Offline fixture integrity | ✅ PASS |" >> "$GITHUB_STEP_SUMMARY"
6767
FIXTURE_SHA=$(sha256sum tests/txcache/manifest.json | cut -d' ' -f1)
6868
echo "" >> "$GITHUB_STEP_SUMMARY"
69-
echo "Fixture manifest SHA-256: `$FIXTURE_SHA`" >> "$GITHUB_STEP_SUMMARY"
69+
printf 'Fixture manifest SHA-256: `%s`\n' "$FIXTURE_SHA" >> "$GITHUB_STEP_SUMMARY"
7070
7171
# ═══════════════════════════════════════════════════════════
72-
# STAGE 2: TEST — pull published emulator, run pytest
72+
# STAGE 2: TEST — build Bitcoin-only emulator, run pytest
7373
# ═══════════════════════════════════════════════════════════
7474

7575
integration:
@@ -129,7 +129,8 @@ jobs:
129129
timeout-minutes: 20
130130
working-directory: keepkey-firmware
131131
run: |
132-
docker build -t kkemu-ci -f scripts/emulator/Dockerfile .
132+
docker build --build-arg coinsupport=-DKK_BITCOIN_ONLY=ON \
133+
-t kkemu-ci -f scripts/emulator/Dockerfile .
133134
134135
- name: Start the emulator
135136
run: |
@@ -153,15 +154,22 @@ jobs:
153154
- name: Wait for emulator
154155
run: |
155156
echo "Waiting for emulator bridge on port 5000..."
157+
ready=false
156158
for i in $(seq 1 30); do
157159
if curl -sf -X POST http://localhost:5000/exchange/main \
158160
-H 'Content-Type: application/json' \
159161
-d '{"data":""}' > /dev/null 2>&1; then
160162
echo "Emulator ready after ${i}s"
163+
ready=true
161164
break
162165
fi
163166
sleep 1
164167
done
168+
[ "$ready" = true ] || {
169+
docker logs kkemu
170+
echo "FATAL: emulator bridge did not become ready" >&2
171+
exit 1
172+
}
165173
166174
# "The emulator answered a ping" is not "the emulator is the right
167175
# firmware". CI ran a 7.16-era suite against a 7.10.0 image for five
@@ -177,6 +185,7 @@ jobs:
177185
KK_TRANSPORT_DEBUG: "127.0.0.1:11045"
178186
KK_MIN_FW: "7.14.3"
179187
KK_UDP_TIMEOUT: "20"
188+
KK_EXPECTED_VARIANT: "EmulatorBTC"
180189
working-directory: keepkey-firmware/deps/python-keepkey/tests
181190
run: |
182191
python - <<'PY'
@@ -198,6 +207,10 @@ jobs:
198207
sys.exit('FATAL: the emulator image predates the tests that run '
199208
'against it. Republish kktech/kkemu from current '
200209
'firmware and pin the new digest above.')
210+
if f.firmware_variant != os.environ['KK_EXPECTED_VARIANT']:
211+
sys.exit('FATAL: expected %s, got firmware variant %r' %
212+
(os.environ['KK_EXPECTED_VARIANT'],
213+
f.firmware_variant))
201214
PY
202215
203216
# Step-level timeout, deliberately: a JOB-level timeout ends the job as
@@ -208,6 +221,7 @@ jobs:
208221
KK_TRANSPORT_MAIN: "127.0.0.1:11044"
209222
KK_TRANSPORT_DEBUG: "127.0.0.1:11045"
210223
PYTHONPATH: "${{ github.workspace }}/keepkey-firmware/deps/python-keepkey"
224+
PYTHONUNBUFFERED: "1"
211225
# A crashed emulator now raises instead of blocking in recv() forever.
212226
KK_UDP_TIMEOUT: "45"
213227
run: |
@@ -235,7 +249,7 @@ jobs:
235249
echo "" >> "$GITHUB_STEP_SUMMARY"
236250
if [ -f "$MANIFEST" ]; then
237251
FIXTURE_SHA=$(sha256sum "$MANIFEST" | cut -d' ' -f1)
238-
echo "Fixture manifest SHA-256: `$FIXTURE_SHA`" >> "$GITHUB_STEP_SUMMARY"
252+
printf 'Fixture manifest SHA-256: `%s`\n' "$FIXTURE_SHA" >> "$GITHUB_STEP_SUMMARY"
239253
echo "" >> "$GITHUB_STEP_SUMMARY"
240254
fi
241255

tests/test_msg_signtx_taproot.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,26 @@
2626

2727

2828

29-
# Synthetic outpoint paying 100000 sat to the BIP-86 first receiving address
30-
# of the "abandon abandon ... about" mnemonic. Taproot signing receives the
31-
# amount and derives the prevout script from the path, so it does not request a
32-
# previous-transaction fixture. The outpoint and expected witness below were
33-
# produced together by an independent BIP-340/341 implementation keyed from
34-
# BIP-86's published xprv.
35-
PREV_TXID = "6e32033911982f7550ab1d26232adfd08711293e15085f77cd27628be0a6ee37"
29+
# Canonical fixture paying 100000 sat to the BIP-86 first receiving address of
30+
# the "abandon abandon ... about" mnemonic. The device requests the previous
31+
# transaction even though Taproot signing also receives the amount and derives
32+
# the prevout script from the path, so this must name a real, hash-consistent
33+
# transaction from txcache rather than a synthetic outpoint. The expected
34+
# witnesses below were independently checked against BIP-341 sighashes with a
35+
# BIP-340 verifier keyed from BIP-86's published xprv.
36+
PREV_TXID = "3e1fdf082678a8a2f378995ffc0e4f853942c55c4ddbc2771b348413eeeca9a4"
3637
IN_AMOUNT = 100000
3738
OUT_AMOUNT = 90000
3839
OUT_ADDRESS = "1BitcoinEaterAddressDontSendf59kuE"
3940

4041
EXPECTED_WITNESS = (
41-
"afe221b16d648a1ad7329f9765930732380cc67765bd73af7ce13b5991146851"
42-
"2d9ee77e34af56fe1f59f98372011f7cb400ced614d808c690c5ba907fb62de9"
42+
"e11beb22fd50225a4fa53a61738993cc742cc6a2361faea0313b0b456300669c"
43+
"2d9ebd503e11855e5bc8018d7bfd5122d578470e1e4e65820705db595724f9eb"
4344
)
4445

4546
EXPECTED_CHANGE_WITNESS = (
46-
"e3c44408fe61256ad406733f100f1ee856eb31854335efa59e60a61ea5d41ab"
47-
"341802f0cccb55f644042a1ab390f0a406b9d3efe3996d05442b4ee43d5355eab"
47+
"ed37247c670b8b260f2c5a619c8f1443493ea6f1eb6230adce5fbafa4b3067e1"
48+
"879a905d40db728c1771207843b2ec03a40484975653e29e583cfc0964d0c95c"
4849
)
4950
EXPECTED_CHANGE_SCRIPT = (
5051
"5120882d74e5d0572d5a816cef0041a96b6c1de832f6f9676d9605c44d5e9a97d3dc"
@@ -65,19 +66,19 @@
6566
# `signature` alone was populated correctly even while the witness and the
6667
# locktime footer were being dropped on the wire.
6768
EXPECTED_SERIALIZED_TX = (
68-
"0100000000010137eea6e08b6227cd775f08153e291187d0df2a23261dab50752f98"
69-
"113903326e0000000000ffffffff01905f0100000000001976a914759d6677091e97"
70-
"3b9e9d99f19c68fbf43e3f05f988ac0140afe221b16d648a1ad7329f976593073238"
71-
"0cc67765bd73af7ce13b59911468512d9ee77e34af56fe1f59f98372011f7cb400ce"
72-
"d614d808c690c5ba907fb62de900000000"
69+
"01000000000101a4a9ecee1384341b77c2db4d5cc54239854f0efc5f9978f3a2a878"
70+
"2608df1f3e0000000000ffffffff01905f0100000000001976a914759d6677091e973b"
71+
"9e9d99f19c68fbf43e3f05f988ac0140e11beb22fd50225a4fa53a61738993cc742c"
72+
"c6a2361faea0313b0b456300669c2d9ebd503e11855e5bc8018d7bfd5122d578470e"
73+
"1e4e65820705db595724f9eb00000000"
7374
)
7475
EXPECTED_SERIALIZED_TX_CHANGE = (
75-
"0100000000010137eea6e08b6227cd775f08153e291187d0df2a23261dab50752f98"
76-
"113903326e0000000000ffffffff0250c30000000000001976a914759d6677091e97"
77-
"3b9e9d99f19c68fbf43e3f05f988ac409c000000000000225120882d74e5d0572d5a"
78-
"816cef0041a96b6c1de832f6f9676d9605c44d5e9a97d3dc0140e3c44408fe61256a"
79-
"d406733f100f1ee856eb31854335efa59e60a61ea5d41ab341802f0cccb55f644042"
80-
"a1ab390f0a406b9d3efe3996d05442b4ee43d5355eab00000000"
76+
"01000000000101a4a9ecee1384341b77c2db4d5cc54239854f0efc5f9978f3a2a878"
77+
"2608df1f3e0000000000ffffffff0250c30000000000001976a914759d6677091e973b"
78+
"9e9d99f19c68fbf43e3f05f988ac409c000000000000225120882d74e5d0572d5a81"
79+
"6cef0041a96b6c1de832f6f9676d9605c44d5e9a97d3dc0140ed37247c670b8b260f"
80+
"2c5a619c8f1443493ea6f1eb6230adce5fbafa4b3067e1879a905d40db728c177120"
81+
"7843b2ec03a40484975653e29e583cfc0964d0c95c00000000"
8182
)
8283
EXPECTED_SERIALIZED_TX_MIXED = (
8384
"01000000000102a4a9ecee1384341b77c2db4d5cc54239854f0efc5f9978f3a2a878"

tests/test_msg_solana_display_disclosure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def build_memo_tx(signer, memo):
5757
class TestSolanaDisplayDisclosure(common.KeepKeyTest):
5858
def setUp(self):
5959
super(TestSolanaDisplayDisclosure, self).setUp()
60+
self.requires_fullFeature()
6061
self.requires_firmware("7.14.2")
6162
self.setup_mnemonic_allallall()
6263

tests/test_msg_solana_instruction_disclosure.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def build_tx(account_keys, required_signatures, instructions,
6262
class TestSolanaInstructionDisclosure(common.KeepKeyTest):
6363
def setUp(self):
6464
super(TestSolanaInstructionDisclosure, self).setUp()
65+
self.requires_fullFeature()
6566
self.requires_firmware("7.14.2")
6667
self.setup_mnemonic_allallall()
6768
response = self.client.call(solana.SolanaGetAddress(

0 commit comments

Comments
 (0)