From c8f0e5a6a08600d5330088edd1054b5c2253584c Mon Sep 17 00:00:00 2001 From: Grandthrax <1507729+Grandthrax@users.noreply.github.com> Date: Tue, 6 Apr 2021 15:49:24 +0100 Subject: [PATCH] feat: test for double accounting on withdrawal los (#267) Co-authored-by: Sam Priestley --- tests/functional/vault/test_withdrawal.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/functional/vault/test_withdrawal.py b/tests/functional/vault/test_withdrawal.py index d8a49c07..08365f9d 100644 --- a/tests/functional/vault/test_withdrawal.py +++ b/tests/functional/vault/test_withdrawal.py @@ -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