Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
fix: oracle test
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Nov 9, 2023
1 parent 6278e95 commit 7181a3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions tests/test_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def test__profitable_report__with_fee(
rewards,
amount,
whale,
factory,
RELATIVE_APPROX,
keeper,
):
Expand Down Expand Up @@ -135,7 +136,11 @@ def test__profitable_report__with_fee(

assert profit > 0

expected_performance_fee = profit * performance_fee // MAX_BPS
(protocol_fee, protocol_fee_recipient) = factory.protocol_fee_config()

expected_performance_fee = (
(profit * performance_fee // MAX_BPS) * (10_000 - protocol_fee) // MAX_BPS
)

# TODO: Implement logic so totalDebt == amount + profit
check_strategy_totals(
Expand All @@ -159,8 +164,6 @@ def test__profitable_report__with_fee(

strategy.redeem(expected_performance_fee, rewards, rewards, sender=rewards)

check_strategy_totals(strategy, total_assets=0, total_debt=0, total_idle=0)

assert asset.balanceOf(rewards) >= rewards_balance_before + expected_performance_fee


Expand Down
2 changes: 1 addition & 1 deletion tests/test_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def check_oracle(oracle, strategy, user):

# TODO: Uncomment if there are setter functions to test.
"""
with reverts("Ownable: caller is not the owner"):
with reverts("!governance"):
oracle.setterFunction(setterVariable, sender=user)
management = strategy.management()
Expand Down

0 comments on commit 7181a3c

Please sign in to comment.