Skip to content

Commit

Permalink
test: add asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
haythemsellami committed Jun 14, 2024
1 parent 42832ad commit 82d3431
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/e2e/PerformanceFeeE2ETest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,19 @@ contract PerformanceFeeE2ETest is FourSixTwoSixAggBase {

uint256 expectedPerformanceFee = yield * fourSixTwoSixAgg.performanceFee() / 1e18;

FourSixTwoSixAgg.Strategy memory strategyBeforeHarvest = fourSixTwoSixAgg.getStrategy(address(eTST));
uint256 totalAllocatedBefore = fourSixTwoSixAgg.totalAllocated();

// harvest
vm.prank(user1);
fourSixTwoSixAgg.harvest(address(eTST));

assertEq(assetTST.balanceOf(feeRecipient), expectedPerformanceFee);
assertEq(
fourSixTwoSixAgg.getStrategy(address(eTST)).allocated,
strategyBeforeHarvest.allocated + yield - expectedPerformanceFee
);
assertEq(fourSixTwoSixAgg.totalAllocated(), totalAllocatedBefore + yield - expectedPerformanceFee);

// full withdraw, will have to withdraw from strategy as cash reserve is not enough
{
Expand Down

0 comments on commit 82d3431

Please sign in to comment.