Skip to content

misc fixes#452

Merged
liquid-8 merged 1 commit into
uniswap-python:dev/v4-finfrom
liquid-8:uniswap4_RC
May 4, 2026
Merged

misc fixes#452
liquid-8 merged 1 commit into
uniswap-python:dev/v4-finfrom
liquid-8:uniswap4_RC

Conversation

@liquid-8
Copy link
Copy Markdown
Member

@liquid-8 liquid-8 commented May 4, 2026

No description provided.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 4, 2026

Greptile Summary

This PR makes two fixes: it replaces the generic tuple[] ABI type specifier with the fully-qualified (address,uint24,int24,address,bytes)[] in the encode() calls for both token_to_token_swap_exact_input and token_to_token_swap_exact_output, correctly matching the PathKey dataclass layout. It also adds a does_not_raise context manager to the test file, though it is not yet used.

Confidence Score: 4/5

Safe to merge; the ABI fix is correct and the only concern is an unused helper in tests.

The core change — replacing tuple[] with the explicit (address,uint24,int24,address,bytes)[] ABI type — is correct and matches the PathKey dataclass definition. The only finding is a P2: does_not_raise is defined but never used in the test file.

tests/test_uniswap4.py — does_not_raise helper is unused dead code.

Important Files Changed

Filename Overview
uniswap/uniswap4.py Replaces generic tuple[] with the explicit ABI type (address,uint24,int24,address,bytes)[] in both token_to_token_swap_exact_input and token_to_token_swap_exact_output, correctly matching the PathKey dataclass field layout.
tests/test_uniswap4.py Adds does_not_raise context manager helper that is defined but never used anywhere in the test file — dead code.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant Uniswap4
    participant eth_abi as eth_abi.encode
    participant UniversalRouter

    Caller->>Uniswap4: token_to_token_swap_exact_input(input_token, qty, ...)
    Uniswap4->>eth_abi: encode(["(address,(address,uint24,int24,address,bytes)[],uint128,uint128)"], [params])
    Note over eth_abi: Previously used tuple[] — now uses explicit PathKey ABI type
    eth_abi-->>Uniswap4: exact_input_params bytes
    Uniswap4->>UniversalRouter: execute(V4_SWAP commands, inputs, deadline)
    UniversalRouter-->>Caller: tx hash
Loading

Reviews (1): Last reviewed commit: "misc fixes" | Re-trigger Greptile

Comment thread tests/test_uniswap4.py
@liquid-8 liquid-8 merged commit 551fcd4 into uniswap-python:dev/v4-fin May 4, 2026
1 of 5 checks passed
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