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

Sorting tokens in fixture does not work #99

Open
sz-piotr opened this issue Sep 15, 2020 · 5 comments
Open

Sorting tokens in fixture does not work #99

sz-piotr opened this issue Sep 15, 2020 · 5 comments

Comments

@sz-piotr
Copy link

https://github.com/Uniswap/uniswap-v2-core/blob/4dd59067c76dea4a0e8e4bfdda41877a6b16dedc/test/shared/fixtures.ts#L40

Because ethers returns a string from this method call, .address always results in undefined, thus the order of tokens is never changed.

@moodysalem
Copy link
Contributor

Good catch! I guess token0 and token1 must always be the same for the fixture, so we never had failing tests out of it.

@Devilla
Copy link

Devilla commented Oct 28, 2020

Good catch! I guess token0 and token1 must always be the same for the fixture, so we never had failing tests out of it.

Sir, how can token0 and token1 be same for pairFixture ?

@moodysalem
Copy link
Contributor

I mean same addresses across test runs (but token0 != token1), since we use the same mnemonic for every test run

@Devilla
Copy link

Devilla commented Oct 29, 2020

Okay so it'll fail for different pair address and pass for same pair address right?

@ghost
Copy link

ghost commented Dec 31, 2023

I think the best fix would be to lowercase the addresses of the token and just compare like how it is done from the factory contract as well.

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

No branches or pull requests

3 participants