Uniswap / v2-core

🦄 🦄 Core smart contracts of Uniswap V2

Home Page:https://uniswap.org/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sorting tokens in fixture does not work

sz-piotr opened this issue · comments

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.

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

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 ?

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

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

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.