Skip to content

chore(universal-router-sdk): add mock pools and test for V4 split routes#513

Draft
jsy1218 wants to merge 8 commits intomainfrom
siyujiang/test-guidestar-routes
Draft

chore(universal-router-sdk): add mock pools and test for V4 split routes#513
jsy1218 wants to merge 8 commits intomainfrom
siyujiang/test-guidestar-routes

Conversation

@jsy1218
Copy link
Member

@jsy1218 jsy1218 commented Feb 11, 2026

PR Scope

Please title your PR according to the following types and scopes following conventional commits:

  • fix(SDK name): will trigger a patch version
  • chore(<type>): will not trigger any release and should be used for internal repo changes
  • <type>(public): will trigger a patch version for non-code changes (e.g. README changes)
  • feat(SDK name): will trigger a minor version
  • feat(breaking): will trigger a major version for a breaking change

Description

[Summary of the change, motivation, and context]

How Has This Been Tested?

[e.g. Manually, E2E tests, unit tests, Storybook]

Are there any breaking changes?

[e.g. Type definitions, API definitions]

If there are breaking changes, please ensure you bump the major version Bump the major version (by using the title feat(breaking): ...), post a notice in #eng-sdks, and explicitly notify all Uniswap Labs consumers of the SDK.

(Optional) Feedback Focus

[Specific parts of this PR you'd like feedback on, or that reviewers should pay closer attention to]

(Optional) Follow Ups

[Things that weren't addressed in this PR, ways you plan to build on this work, or other ways this work could be extended]


✨ Claude-Generated Content

PR Scope

Please title your PR according to the following types and scopes following conventional commits:

  • fix(SDK name): will trigger a patch version
  • chore(<type>): will not trigger any release and should be used for internal repo changes
  • <type>(public): will trigger a patch version for non-code changes (e.g. README changes)
  • feat(SDK name): will trigger a minor version
  • feat(breaking): will trigger a major version for a breaking change

Description

Adds test infrastructure for V4 split route calldata encoding in universal-router-sdk to support guidestar routes testing. This includes new mock tokens, mock V4 pools, and a test case verifying that split routes across multiple V4 pools encode correctly.

Changes

  • Added USDT and UNI token definitions to test/utils/uniswapData.ts
  • Added new mock V4 pools: ETH_USDT_V4, USDC_USDT_V4 in uniswapTrades.test.ts
  • Added test case: encodes a split exactInput with 2 routes v4 USDC -> USDT, v4 USDC -> ETH -> USDT
  • Fixed duplicate parseUnits import in uniswapTrades.test.ts
  • Changed @uniswap/router-sdk dependency to local tarball tmp/router-sdk-guidestar-routes-1.tgz for testing
  • Modified router-sdk pool duplication check to support guidestar routes with shared pools

How Has This Been Tested?

Unit tests - the new test case validates split V4 route calldata encoding for USDC → USDT (single hop) and USDC → ETH → USDT (multi-hop) routes.

Are there any breaking changes?

No - test-only changes with a local dependency for development/testing purposes.

(Optional) Feedback Focus

This PR uses a local router-sdk tarball with modified behavior for pool duplication validation. Review whether this approach is appropriate for testing guidestar routes.

(Optional) Follow Ups

  • Replace local tarball with published router-sdk version once guidestar routes support is released
  • Consider adding more test cases for other guidestar route patterns

@github-actions github-actions bot changed the title fix: mock guidestar route object for calldata fix(universal-router-sdk): add mock pools and test for V4 split routes Feb 11, 2026
@github-actions github-actions bot changed the title fix(universal-router-sdk): add mock pools and test for V4 split routes chore(universal-router-sdk): add mock pools and test for V4 split routes Feb 11, 2026
@socket-security
Copy link

socket-security bot commented Feb 11, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​uniswap/​router-sdk@​0.0.0100100100100100

View full report

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.

2 participants