Uniswap / v2-core

🦄 🦄 Core smart contracts of Uniswap V2
https://uniswap.org/docs
GNU General Public License v3.0
2.93k stars 3.15k forks source link

price{0,1}CumulativeLast pair test is flaky #72

Closed moodysalem closed 4 years ago

moodysalem commented 4 years ago

I think this probably has to do with the mineBlock method, or how the timestamps are moving in the underlying evm.

I think we probably should just have a method on the contract that gets the current timestamp so we can override it for tests, per @MicahZoltu's suggestion. This is how I've always done it as well.

MicahZoltu commented 4 years ago

I saw this in my inbox 10 minutes after I finished figuring out how to mock the system clock in my docker containers... I still advocate for mockable timestamps, but I am now salty with my advocacy!

MicahZoltu commented 4 years ago

@moodysalem Re: mineBlock from ganache, this may be possibly related: https://github.com/trufflesuite/ganache-core/issues/509