Skip to content

Commit

Permalink
fix: lossy test
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Jan 30, 2024
1 parent 97d777b commit c13d673
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unit/vault/test_strategy_withdraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ def test_redeem__half_of_strategy_assets_from_locked_lossy_strategy_with_unreali
asset,
create_vault,
create_strategy,
create_locked_strategy,
create_lossy_strategy,
user_deposit,
add_strategy_to_vault,
add_debt_to_strategy,
Expand All @@ -1822,7 +1822,7 @@ def test_redeem__half_of_strategy_assets_from_locked_lossy_strategy_with_unreali
) # withdraw a quarter deposit (half of strategy debt)
shares = amount
liquid_strategy = create_strategy(vault)
lossy_strategy = create_locked_strategy(vault)
lossy_strategy = create_lossy_strategy(vault)
strategies = [lossy_strategy, liquid_strategy]
max_loss = 10_000

Expand All @@ -1840,9 +1840,9 @@ def test_redeem__half_of_strategy_assets_from_locked_lossy_strategy_with_unreali
add_debt_to_strategy(gov, strategy, vault, amount_per_strategy)

# lose half of assets in lossy strategy
asset.transfer(gov, amount_to_lose, sender=lossy_strategy)
lossy_strategy.setLoss(gov, amount_to_lose, sender=lossy_strategy)
# Lock half the remaining funds.
lossy_strategy.setLockedFunds(amount_to_lock, DAY, sender=gov)
lossy_strategy.setLockedFunds(amount_to_lock, sender=gov)

tx = vault.redeem(
amount_to_withdraw,
Expand All @@ -1861,7 +1861,7 @@ def test_redeem__half_of_strategy_assets_from_locked_lossy_strategy_with_unreali

event = list(tx.decode_logs(vault.Withdraw))

assert len(event) >= 1
assert len(event) > 1
n = len(event) - 1
assert event[n].sender == fish
assert event[n].receiver == fish
Expand Down Expand Up @@ -1889,7 +1889,7 @@ def test_redeem__half_of_strategy_assets_from_locked_lossy_strategy_with_unreali
assert asset.balanceOf(vault) == 0
assert asset.balanceOf(liquid_strategy) == amount_per_strategy - expected_liquid_out
assert (
asset.balanceOf(lossy_strategy)
asset.balanceOf(lossy_strategy.yieldSource())
== amount_per_strategy - amount_to_lose - expected_locked_out
) # withdrawn from strategy
assert (
Expand Down

0 comments on commit c13d673

Please sign in to comment.