Skip to content

Commit b2edbff

Browse files
Merge pull request #223 from keepkey/fix/hive-wire-asset-symbols
test: two expectations that pinned firmware defects (Hive wire symbol, 1-bit frame hash)
2 parents 7f538a9 + 3cc2be2 commit b2edbff

4 files changed

Lines changed: 19 additions & 9 deletions

File tree

‎.circleci/config.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ jobs:
3838
git remote add origin \
3939
https://github.com/BitHighlander/keepkey-firmware.git
4040
git fetch --depth 1 origin \
41-
d0a494a805533f02387f58d89dbb6f1fb09a621a
41+
d33f1711c3b2b205f64c5dc35fdec02926a6dc63
4242
git checkout --detach FETCH_HEAD
4343
test "$(git rev-parse HEAD)" = \
44-
d0a494a805533f02387f58d89dbb6f1fb09a621a
44+
d33f1711c3b2b205f64c5dc35fdec02926a6dc63
4545
4646
# Match firmware CI's build set. A recursive init reaches optional
4747
# trezor-firmware vendors that do not support shallow HTTPS clones.

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
uses: actions/checkout@v4
126126
with:
127127
repository: BitHighlander/keepkey-firmware
128-
ref: d0a494a805533f02387f58d89dbb6f1fb09a621a
128+
ref: d33f1711c3b2b205f64c5dc35fdec02926a6dc63
129129
path: keepkey-firmware
130130

131131
# NOT `submodules: recursive`. trezor-firmware carries a micropython
@@ -362,7 +362,7 @@ jobs:
362362
uses: actions/checkout@v4
363363
with:
364364
repository: BitHighlander/keepkey-firmware
365-
ref: e6a6711e5e4164d3b3840356dc301aa873f1fbf7
365+
ref: 4125e1c7409b1cb7b08ba595bc408e3128fc24ca
366366
path: keepkey-firmware
367367

368368
- name: Init the submodules the emulator build needs
@@ -543,10 +543,10 @@ jobs:
543543
matrix:
544544
include:
545545
- release: "7.14.3"
546-
firmware_ref: e6a6711e5e4164d3b3840356dc301aa873f1fbf7
546+
firmware_ref: 4125e1c7409b1cb7b08ba595bc408e3128fc24ca
547547
min_fw: "7.14.3"
548548
- release: "7.15"
549-
firmware_ref: d0a494a805533f02387f58d89dbb6f1fb09a621a
549+
firmware_ref: d33f1711c3b2b205f64c5dc35fdec02926a6dc63
550550
min_fw: "7.15.0"
551551

552552
# KK_BITCOIN_ONLY=ON is a second shipping product, not a build flavour:

‎tests/test_msg_ethereum_signtx_xfer.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,14 @@ def test_native_pseudo_address_transfer_is_unknown_off_mainnet(self):
5959
data=erc20_data, chain_id=257,
6060
)
6161
self.assertGreaterEqual(len(recorder.screens), 2)
62+
# The 7.15 hash changed when the dylib's 1-bit serialiser stopped
63+
# treating every nonzero shade as lit and adopted the ordered
64+
# dithering the DebugLink layout and the capture ring already used
65+
# (display_mono_pixel_is_lit). The frame this now hashes is the one
66+
# the device's other evidence paths produce for the same screen;
67+
# the old value came from the one serialiser that disagreed.
6268
expected_frame = (
63-
"3915d325da0a0e9842d7eb3eaa6e01ef0bbf7e010790af883ca1a7f30770ae8f"
69+
"beb98f914a77d933b458b625085cef4ea92a2a243bf56bee37abf95294d42497"
6470
if self.firmware_at_least("7.15.0") else
6571
"b0a3026e7af1778ebd71a968ace25c03945cccf2d8abc951e5dd65abc04e914e"
6672
)

‎tests/test_msg_hive.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,11 @@ def test_hive_sign_transfer(self):
353353
self.assertEqual((ref_num, ref_prefix, expiration), (12345, 67890, 1700000000))
354354
self.assertEqual(r.string(), b"kktester") # from
355355
self.assertEqual(r.string(), b"kkrecipient") # to
356-
self.assertEqual(r.asset(), (1000, 3, "HIVE"))
356+
# The WIRE spelling, per _WIRE_SYMBOL above: hived writes "STEEM" for
357+
# HIVE, and this reads the bytes the device actually signed. Asserting
358+
# the display name here passed only while the firmware serialized a
359+
# symbol the chain does not use.
360+
self.assertEqual(r.asset(), (1000, 3, _WIRE_SYMBOL["HIVE"]))
357361
self.assertEqual(r.string(), b"kktest") # memo
358362
self.assertEqual(r.varint(), 0) # extensions
359363
r.assert_end()
@@ -399,7 +403,7 @@ def test_hive_sign_account_create(self):
399403
r = _Reader(resp.serialized_tx)
400404
ref_num, ref_prefix, expiration = _parse_header(r, HIVE_OP_ACCOUNT_CREATE)
401405
self.assertEqual((ref_num, ref_prefix, expiration), (12345, 67890, 1700000000))
402-
self.assertEqual(r.asset(), (3000, 3, "HIVE")) # fee
406+
self.assertEqual(r.asset(), (3000, 3, _WIRE_SYMBOL["HIVE"])) # fee
403407
self.assertEqual(r.string(), b"kksponsor") # creator
404408
self.assertEqual(r.string(), b"kktestacct") # new_account_name
405409
self.assertEqual(r.authority(), raw[ROLE_OWNER])

0 commit comments

Comments
 (0)