Skip to content

Commit

Permalink
docs: apply suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Merlin Egalite <[email protected]>
  • Loading branch information
MerlinEgalite authored Aug 15, 2023
1 parent 85fc322 commit 4aa66f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
11 changes: 5 additions & 6 deletions test/forge/integration/TestIntegrationBorrow.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@ contract IntegrationBorrowTest is BaseTest {
function testBorrowMarketNotCreated(
Market memory marketFuzz,
address borrowerFuzz,
address RECEIVER,
uint256 amount
) public {
vm.assume(neq(marketFuzz, market) && RECEIVER != address(0));
vm.assume(neq(marketFuzz, market));

vm.prank(borrowerFuzz);
vm.expectRevert(bytes(ErrorsLib.MARKET_NOT_CREATED));
morpho.borrow(marketFuzz, amount, 0, borrowerFuzz, RECEIVER);
}

function testBorrowZeroAmount(address borrowerFuzz, address RECEIVER) public {
function testBorrowZeroAmount(address borrowerFuzz) public {
vm.prank(borrowerFuzz);
vm.expectRevert(bytes(ErrorsLib.INCONSISTENT_INPUT));
morpho.borrow(market, 0, 0, borrowerFuzz, RECEIVER);
}

function testBorrowInconsistentInput(address borrowerFuzz, uint256 amount, uint256 shares, address RECEIVER)
function testBorrowInconsistentInput(address borrowerFuzz, uint256 amount, uint256 shares)
public
{
amount = bound(amount, 1, MAX_TEST_AMOUNT);
Expand All @@ -47,8 +46,8 @@ contract IntegrationBorrowTest is BaseTest {
morpho.borrow(market, amount, 0, borrowerFuzz, address(0));
}

function testBorrowUnauthorized(address supplier, address attacker, address RECEIVER, uint256 amount) public {
vm.assume(supplier != attacker && supplier != address(0) && RECEIVER != address(0));
function testBorrowUnauthorized(address supplier, address attacker, uint256 amount) public {
vm.assume(supplier != attacker && supplier != address(0));
amount = bound(amount, 1, MAX_TEST_AMOUNT);

_supply(amount);
Expand Down
2 changes: 1 addition & 1 deletion test/forge/integration/TestIntegrationSupply.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ contract IntegrationSupplyTest is BaseTest {
using SharesMathLib for uint256;

function testSupplyMarketNotCreated(Market memory marketFuzz, uint256 amount) public {
vm.assume(neq(marketFuzz, market) && SUPPLIER != address(0));
vm.assume(neq(marketFuzz, market));

vm.prank(SUPPLIER);
vm.expectRevert(bytes(ErrorsLib.MARKET_NOT_CREATED));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ import "../BaseTest.sol";
contract IntegrationWithdrawCollateralTest is BaseTest {
using MathLib for uint256;

function testWithdrawCollateralMarketNotCreated(Market memory marketFuzz, address RECEIVER) public {
vm.assume(neq(marketFuzz, market) && RECEIVER != address(0));
function testWithdrawCollateralMarketNotCreated(Market memory marketFuzz) public {
vm.assume(neq(marketFuzz, market));

vm.prank(SUPPLIER);
vm.expectRevert(bytes(ErrorsLib.MARKET_NOT_CREATED));
morpho.withdrawCollateral(marketFuzz, 1, SUPPLIER, RECEIVER);
}

function testWithdrawCollateralZeroAmount(uint256 amount) public {
vm.assume(SUPPLIER != address(0));
amount = bound(amount, 1, MAX_TEST_AMOUNT);

collateralToken.setBalance(SUPPLIER, amount);
Expand Down

0 comments on commit 4aa66f5

Please sign in to comment.