TrueFiEng / Waffle

Library for writing and testing smart contracts.
https://getwaffle.io
MIT License
965 stars 164 forks source link

Support side-effects on mocks #586

Open suranap opened 3 years ago

suranap commented 3 years ago

Similar to Python's Mock class here. I can't figure out how to do this with Waffle.

For example, I want to mock a UniswapV2Pair to force removeLiquidity to have different behaviors. This is easy with mocks. However, it also needs to transfer tokens to the calling contract. This is a side-effect caused when removing liquidity.

rzadp commented 2 years ago

Might be a duplicate of https://github.com/TrueFiEng/Waffle/issues/545