Skip to content

Commit

Permalink
fix: forge fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dangerousfood committed Jan 16, 2024
1 parent dcbe6cd commit e01ea03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/enforcers/AstariaV1BorrowerEnforcer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ contract AstariaV1BorrowerEnforcer is BorrowerEnforcer {
);

V1BorrowerDetails memory v1Details = abi.decode(caveatData, (V1BorrowerDetails));

if (loanAmount < v1Details.minAmount || loanAmount > v1Details.maxAmount) {
// Debt amount is less than the current caveat amount
revert LoanAmountOutOfBounds();
Expand All @@ -93,17 +93,15 @@ contract AstariaV1BorrowerEnforcer is BorrowerEnforcer {
// Loan rate is greater than the current caveat rate
revert LoanRateExceedsCurrentRate();
}


BorrowerEnforcer.Details memory caveatDetails = v1Details.details;
// Update the caveat loan rate and amount
Starport.Loan memory caveatLoan = caveatDetails.loan;
uint256 i = 0;
for(;i<caveatLoan.collateral.length;){
if(caveatLoan.collateral[i].amount < loan.collateral[i].amount){
for (; i < caveatLoan.collateral.length;) {
if (caveatLoan.collateral[i].amount < loan.collateral[i].amount) {
revert AmountExceedsCaveatCollateral();
}
else {
} else {
caveatLoan.collateral[i].amount = loan.collateral[i].amount;
}
unchecked {
Expand Down
4 changes: 2 additions & 2 deletions test/TestV1BorrowerEnforcer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ contract TestV1BorrowerEnforcer is AstariaV1Test, AstariaV1BorrowerEnforcer {
// amount above the expected collateral amount
vm.expectRevert(AmountExceedsCaveatCollateral.selector);
borrowerEnforcer.validate(new AdditionalTransfer[](0), loan, abi.encode(details));

// amount below the expected collateral amount
loan.collateral[0].amount-=2;
loan.collateral[0].amount -= 2;
borrowerEnforcer.validate(new AdditionalTransfer[](0), loan, abi.encode(details));
}

Expand Down

0 comments on commit e01ea03

Please sign in to comment.