yearn / yearn-vaults

Yearn Vault smart contracts
https://yearn.finance/
GNU Affero General Public License v3.0
519 stars 317 forks source link

Add testing to vault to handle a faulty strategy reporting bad numbers (equal loss and gain scenario) #77

Closed storming0x closed 3 years ago

storming0x commented 3 years ago

This is an unlikely scenario, but could be good to assert in a test case the behavior for the vault to handle when a strategy is sending weird numbers for some reason like report(gain=100K, loss=100K).

A nice to have more than anything, don't see it as critical on top of other issues.

hrharder commented 3 years ago

what is the expected behavior here? if you can point me to the lines in Vault.vy where this is handled (or at least what the expected behavior is), I could try to write a test case!

storming0x commented 3 years ago

Closing this since its covered here already https://github.com/iearn-finance/yearn-vaults/blob/02bf480541c1087023e38e66e8c6d7ff9c0b986e/tests/functional/vault/test_losses.py#L24