Skip to content

fix: restore green CI (lint gate + two latent test breakages)#85

Open
Reinholdtsen wants to merge 1 commit into
Uniswap:mainfrom
Reinholdtsen:reinholdtsen/fix-ci-green
Open

fix: restore green CI (lint gate + two latent test breakages)#85
Reinholdtsen wants to merge 1 commit into
Uniswap:mainfrom
Reinholdtsen:reinholdtsen/fix-ci-green

Conversation

@Reinholdtsen

Copy link
Copy Markdown

Problem

CI has been red on main. The lint job fails, and because build-and-test
is gated on it (needs: lint), the test suite hasn't run — which hid two
further breakages that surface once lint passes.

Fixes (test/tooling only — no mapping behavior changes)

  1. lintsrc/utils/pricing.ts: the prettier/prettier error was an
    unwinnable conflict between the pre-commit hook's prettier (1.19.1, breaks
    the num.div().times().div() chain onto multiple lines) and CI's
    eslint-prettier (newer, wants one line). Split the chain into two
    statements so both agree. Behavior-identical.
  2. fixture panictests/handlers/constants.ts: set the non-nullable
    isExternalLiquidity on the shared pool fixture so Pool.save() no longer
    panics and aborts the whole run (field added in Populate same fields and introduce boolean flag for external liquidity #72, fixture never updated).
  3. handleSwaptests/handlers/constants.ts: seed the USDC/WETH fixture
    with a realistic sqrtPrice (was '1', a placeholder that yields a
    nonsensical ~Q192 price). Combined with the removal of an intermediate
    pool.save() in Remove duplicate saves #45, that placeholder leaked a stale garbage price into
    the swap's USD accounting. A real price restores the assertion.

Verification

Lint clean and all 62 tests pass via the same matchstick 0.6.0 Docker image CI
uses (build-and-test green end to end).

…ure price)

CI is red at the lint gate; because build-and-test needs lint, the test
suite has not run, hiding two further breakages (confirmed in run Uniswap#80's
Test log).

- pricing.ts: the lint blocker was an unfixable prettier conflict — the
  pre-commit hook's prettier (1.19.1) breaks the num.div().times().div()
  chain onto multiple lines, while CI's eslint prettier/prettier rule (a
  newer prettier) demands one line, so each tool undid the other. Split
  the chain into two statements so both agree. Behavior-identical.
- constants.ts: set the non-nullable isExternalLiquidity on the shared
  pool fixture so Pool.save() no longer panics and aborts the whole run.
- constants.ts: seed the USDC/WETH fixture with a realistic sqrtPrice
  (was '1', which yields a nonsensical ~Q192 price) so handleSwap's USD
  assertions hold. Test-only; no mapping behavior changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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