Skip to content

Commit

Permalink
tests: update tests to add missing functionnalities
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtekgrinder committed Oct 22, 2024
1 parent 3bc5b0c commit bcda179
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions test/fuzz/MultiBlockHarvester.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,21 @@ contract MultiBlockHarvestertTest is Fixture, FunctionUtils {
vm.expectRevert(Errors.NotGovernorOrGuardian.selector);
harvester.setMaxSlippage(1e9);

vm.expectRevert(Errors.NotGovernorOrGuardian.selector);
harvester.updateLimitExposuresYieldAsset(address(XEVT));

vm.expectRevert(Errors.NotGovernorOrGuardian.selector);
harvester.toggleTrusted(alice);
}

function test_OnlyTrusted_RevertWhen_NotTrusted() public {
vm.expectRevert(Errors.NotTrustedOrGuardian.selector);
harvester.setTargetExposure(address(EURC), targetExposure);

vm.expectRevert(Errors.NotTrusted.selector);
harvester.harvest(XEVT, 1e9, new bytes(0));

vm.expectRevert(Errors.NotTrusted.selector);
harvester.finalizeRebalance(EURC, 1e6);
}

function test_SettersHarvester() public {
vm.startPrank(governor);
vm.expectRevert(Errors.InvalidParam.selector);
Expand Down Expand Up @@ -314,6 +322,13 @@ contract MultiBlockHarvestertTest is Fixture, FunctionUtils {
vm.stopPrank();
}

function test_SetTargetExposure() public {
vm.prank(governor);
harvester.setTargetExposure(address(EURC), targetExposure + 1);
(, uint64 currentTargetExposure, , , ) = harvester.yieldBearingData(address(EURC));
assertEq(currentTargetExposure, targetExposure + 1);
}

function test_harvest_TooBigMintedAmount() external {
_loadReserve(EURC, 1e26);
_loadReserve(XEVT, 1e6);
Expand Down

0 comments on commit bcda179

Please sign in to comment.