Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(router-sdk): special case eth, weth fake pool #282

Merged
merged 8 commits into from
Jan 31, 2025

Conversation

snreynolds
Copy link
Member

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]

@snreynolds snreynolds requested review from a team as code owners January 30, 2025 21:05
types.push('uint24', 'uint24', 'address', 'address')
// a tickSpacing of 0 indicates a "fake" v4 pool where the quote actually requires a wrap or unwrap
if (pool.tickSpacing == 0) {
let wrapOrUnwrapEncoding = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrapOrUnwrapEncoding is now always zero?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that is just the "version" that the quoter uses

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aw yes, i was confused because it's a let. just a nit, it can be a constant now, like const WRAP_OR_UNWRAP_ENCODING = 0 at top of the file

@jsy1218
Copy link
Member

jsy1218 commented Jan 30, 2025

@snreynolds wondering if you have time to add a unit test coverage? if not, the change LGTM, otherwise.

@jsy1218 jsy1218 changed the title special case eth, weth fake pool fix(router-sdk): special case eth, weth fake pool Jan 30, 2025
Copy link

graphite-app bot commented Jan 30, 2025

Graphite Automations

"Request reviewers once CI passes on sdks monorepo" took an action on this PR • (01/30/25)

1 reviewer was added and 1 assignee was added to this PR based on Siyu Jiang (See-You John)'s automation.

@snreynolds snreynolds requested a review from jsy1218 January 31, 2025 05:36
if (pool.tickSpacing === 0) {
const wrapOrUnwrapEncoding = 0
path.push(wrapOrUnwrapEncoding, currencyOut.isNative ? ADDRESS_ZERO : currencyOut.wrapped.address)
types.push('uint8', 'address')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the uint8 of 0 for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use that to denote protocol version 0, which just signals a wrap/unwrap in the mixed route quoter

Copy link
Collaborator

@dannythedawger dannythedawger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jsy1218 jsy1218 merged commit cc85a14 into main Jan 31, 2025
7 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.

6 participants