Skip to content

Commit

Permalink
fix: code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
k1rill-fedoseev committed Sep 22, 2023
1 parent c823c8f commit a98f251
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/zkbob/ZkBobPool.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ abstract contract AbstractZkBobPoolTest is AbstractForkTest {
assertEq(IERC20(token).balanceOf(address(pool)), 7_000 ether / D);
assertEq(pool.investedAssetsAmount(), 3_000 ether / D);

skip(1 days);

// bounded by minRebalanceAmount
vm.expectRevert("ZkBobCompounding: insufficient rebalance");
pool.rebalance(3_000 ether / D, type(uint256).max);
Expand Down Expand Up @@ -837,6 +839,22 @@ abstract contract AbstractZkBobPoolTest is AbstractForkTest {
pool.rebalance(0, type(uint256).max);
assertEq(IERC20(token).balanceOf(address(pool)), 9_000 ether / D);
assertEq(pool.investedAssetsAmount(), 1_000 ether / D);

pool.updateYieldParams(
IZkBobPoolAdmin.YieldParams({
yield: pool.yieldParams().yield,
maxInvestedAmount: 50_000 ether / D,
buffer: uint96(20_000 ether / D),
dust: uint96(0.5 ether / D),
interestReceiver: address(this),
yieldOperator: address(this)
})
);

// bounded by investedAssets
pool.rebalance(0, type(uint256).max);
assertEq(IERC20(token).balanceOf(address(pool)), 10_000 ether / D);
assertEq(pool.investedAssetsAmount(), 0 ether / D);
}

function testRebalanceWhenYieldIsAddressZero() public {
Expand Down

0 comments on commit a98f251

Please sign in to comment.