Skip to content

Commit

Permalink
feat: test for double accounting on withdrawal los (#267)
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Priestley <sfpriestley@hotmail.co.uk>
  • Loading branch information
Grandthrax and Sam Priestley authored Apr 6, 2021
1 parent 9056254 commit c8f0e5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/functional/vault/test_withdrawal.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ def test_forced_withdrawal(token, gov, vault, TestStrategy, rando, chain):
with brownie.reverts():
vault.withdraw(1000, rando, 10_001, {"from": rando})

pricePerShareBefore = vault.pricePerShare()
vault.withdraw(1000, rando, 10_000, {"from": rando}) # Opt-in to 100% loss
assert vault.strategies(strategies[0]).dict()["totalLoss"] == 1000
assert token.balanceOf(rando) == 0 # 100% loss (because we didn't wait!)
assert pricePerShareBefore == vault.pricePerShare()

chain.revert() # Back before the withdrawal

Expand Down

0 comments on commit c8f0e5a

Please sign in to comment.