-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(router-sdk): fix mixed route ETH <-> WETH wrong route.path (#299)
## PR Scope Please title your PR according to the following types and scopes following [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/): - `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]_
- Loading branch information
Showing
7 changed files
with
77 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Ether, Token } from '@uniswap/sdk-core' | ||
import { encodeSqrtRatioX96 } from '@uniswap/v3-sdk' | ||
import { Pool as V4Pool } from '@uniswap/v4-sdk' | ||
import { ADDRESS_ZERO } from '../constants' | ||
import { getPathCurrency } from './pathCurrency' | ||
|
||
describe('#getPathCurrency', () => { | ||
const SQRT_RATIO_ONE = encodeSqrtRatioX96(1, 1) | ||
const ETHER = Ether.onChain(1) | ||
const token1 = new Token(1, '0x0000000000000000000000000000000000000002', 18, 't1') | ||
|
||
const pool_v4_eth_token1 = new V4Pool(token1, ETHER, 0, 0, ADDRESS_ZERO, SQRT_RATIO_ONE, 0, 0) | ||
|
||
it('returns eth input', () => { | ||
expect(getPathCurrency(ETHER, pool_v4_eth_token1)).toEqual(ETHER) | ||
}) | ||
}) |