Checks improvements, small logic fix, multi-hop tests added#434
Checks improvements, small logic fix, multi-hop tests added#434liquid-8 merged 1 commit intouniswap-python:dev/v4-finfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev/v4-fin #434 +/- ##
===========================================
Coverage 58.44% 58.44%
===========================================
Files 12 12
Lines 1865 1865
===========================================
Hits 1090 1090
Misses 775 775 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Greptile SummaryThis PR improves the Uniswap v4 Python library with case-insensitive address comparisons, variable renaming for clarity, multi-hop quoter tests, and minor housekeeping. However, a logic regression in Key changes:
Confidence Score: 4/5Not safe to merge as-is — a single-line regression in encode_path_keys_input reverses multi-hop exact-input paths and must be reverted. All other changes (8× .lower() fix, variable renames, removed unused parameter, comment cleanup, new tests) are correct and valuable. The one P1 issue — append replaced by insert(0,...) in encode_path_keys_input — silently breaks any 2+ hop quoteExactInput call. Single-hop paths are unaffected, meaning existing 1-hop tests still pass and the regression can easily go unnoticed. Reverting that single line restores correct behaviour and makes the PR mergeable. uniswap/uniswap4.py line 1502 (encode_path_keys_input) Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant get_quote_exact_input
participant encode_path_keys_input
participant V4Quoter
Caller->>get_quote_exact_input: (ETH, qty, [ETH-USDC pool, USDT-USDC pool])
get_quote_exact_input->>encode_path_keys_input: (path=[ETH-USDC, USDT-USDC], currency_in=ETH)
Note over encode_path_keys_input: OLD (correct): append<br/>→ [PathKey(USDC,fee1), PathKey(USDT,fee2)]
Note over encode_path_keys_input: NEW (regression): insert(0,...)<br/>→ [PathKey(USDT,fee2), PathKey(USDC,fee1)] REVERSED
encode_path_keys_input-->>get_quote_exact_input: encoded_path
get_quote_exact_input->>V4Quoter: quoteExactInput({ETH, encoded_path, qty})
Note over V4Quoter: hop[0]: inputCurrency=ETH + PathKey(USDT,fee2)<br/>→ looks for ETH-USDT pool (WRONG)
V4Quoter-->>get_quote_exact_input: revert / wrong quote
get_quote_exact_input-->>Caller: error
Reviews (1): Last reviewed commit: "Checks improvements, small logic fix, mu..." | Re-trigger Greptile |
No description provided.