Skip to content

Commit

Permalink
test: do not revert when nothing to tip
Browse files Browse the repository at this point in the history
  • Loading branch information
QGarchery committed Mar 14, 2024
1 parent 03d629c commit 5126bdb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion test/prod/aave-v2/TestLifecycle.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ contract TestLifecycle is TestSetup {
_tip(
borrow.market.underlying,
address(user),
borrow.position.total - ERC20(borrow.market.underlying).balanceOf(address(user))
Math.zeroFloorSub(
borrow.position.total,
ERC20(borrow.market.underlying).balanceOf(address(user))
)
);
user.approve(borrow.market.underlying, borrow.position.total);
user.repay(borrow.market.poolToken, address(user), type(uint256).max);
Expand Down
5 changes: 4 additions & 1 deletion test/prod/compound/TestLifecycle.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ contract TestLifecycle is TestSetup {
_tip(
borrow.market.underlying,
address(user),
borrow.position.total - ERC20(borrow.market.underlying).balanceOf(address(user))
Math.zeroFloorSub(
borrow.position.total,
ERC20(borrow.market.underlying).balanceOf(address(user))
)
);
user.approve(borrow.market.underlying, borrow.position.total);
user.repay(borrow.market.poolToken, address(user), type(uint256).max);
Expand Down

0 comments on commit 5126bdb

Please sign in to comment.