Skip to content

test(uniswap): run the liquidity tests on the emulator instead of skipping them - #32

Merged
BitHighlander merged 1 commit into
masterfrom
fix/unskip-uniswap-liquidity
Aug 21, 2026
Merged

test(uniswap): run the liquidity tests on the emulator instead of skipping them#32
BitHighlander merged 1 commit into
masterfrom
fix/unskip-uniswap-liquidity

Conversation

@BitHighlander

Copy link
Copy Markdown
Owner

These three tests are skipped whenever firmware_variant starts with "Emulator" — and the emulator is the only thing CI runs, so they have never executed in CI on any branch.

The firmware test report reads 327/330 PASSED, 3 skipped (withheld) with every EVM section green. These are the 3 withheld.

What the skip was hiding

The guard said "Skip until emulator issue resolved", and the comment above it said "Pre-existing, unrelated to clear-signing" and "on-device this path is exercised by the app". Both wrong — it is a firmware logic defect that fails on hardware too.

confirmFromAccountMatch() in lib/firmware/ethereum_contracts/zxliquidtx.c ended in return is_self, refusing the transaction after the user approved the recipient screen. ethereum.c turns that into ActionCancelled, so the device answered Signing cancelled by user for a transaction the user had just confirmed. Every removeLiquidityETH to a third party was unsignable.

Lifting the skip, the vectors name the split themselves:

test result recipient word
test_sign_uni_add_liquidity_ETH PASSED # eth address (self)
test_sign_uni_approve_liquidity_ETH PASSED n/a
test_sign_uni_remove_liquidity_ETH FAILED # to address (not self)

Requires

keepkey-firmware fix(evm): a Uniswap recipient screen the user approved is an approval, on alpha. Against that firmware all three pass — and they assert exact sig_v/sig_r/sig_s, so this is the device signing the right bytes, not merely not erroring.

Keeping the skip would keep the report green by not looking.

…pping them

These three were skipped whenever firmware_variant starts with "Emulator", and
the emulator is the only thing CI runs — so they have never executed in CI on
any branch. The firmware test report reads "327/330 PASSED, 3 skipped
(withheld)" with every EVM section green, and these are the 3.

The skip said "Skip until emulator issue resolved" and the comment above it
said "Pre-existing, unrelated to clear-signing" and "on-device this path is
exercised by the app". Both were wrong. Lifting the skip found a firmware logic
defect that fails on hardware too: confirmFromAccountMatch() in zxliquidtx.c
ended in `return is_self`, refusing the transaction AFTER the user approved the
recipient screen, so the device answered "Signing cancelled by user" for a
transaction the user had just confirmed.

The vectors show the split themselves — add_liquidity's recipient word is
commented "# eth address (self)" and passes; remove_liquidity's is
"# to address (not self)" and failed.

Fixed in keepkey-firmware as "fix(evm): a Uniswap recipient screen the user
approved is an approval". Against that firmware all three pass, asserting their
exact sig_v/sig_r/sig_s, so the device is signing the right bytes.

Keeping the skip would keep the report green by not looking.
@BitHighlander
BitHighlander merged commit 9f3b176 into master Aug 21, 2026
2 of 5 checks passed
@BitHighlander
BitHighlander deleted the fix/unskip-uniswap-liquidity branch August 21, 2026 03:36
BitHighlander added a commit to BitHighlander/keepkey-firmware that referenced this pull request Aug 21, 2026
pyk master gains "test(uniswap): run the liquidity tests on the emulator instead
of skipping them" (BitHighlander/python-keepkey#32).

Those three were skipped whenever firmware_variant starts with "Emulator", and
the emulator is the only thing CI runs, so they had never executed in CI on any
branch. They are the "3 skipped (withheld)" behind the report's
"327/330 PASSED" and its green EVM sections.

With this pin they execute. Against this tree all three pass, asserting their
exact sig_v/sig_r/sig_s, so the device signs the right bytes rather than merely
not erroring. Verified locally against the emulator built from this commit:

    test_sign_uni_add_liquidity_ETH      PASSED
    test_sign_uni_approve_liquidity_ETH  PASSED
    test_sign_uni_remove_liquidity_ETH   PASSED

The report should now read 330/330 with nothing withheld. If a future run shows
these skipped again, the pin moved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant