-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,308 additions
and
1,539 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
pragma solidity ^0.8.18; | ||
|
||
import "./TestContracts/DevTestSetup.sol"; | ||
|
||
|
||
contract BorrowerOperationsTest is DevTestSetup { | ||
// closeTrove(): reverts when trove is the only one in the system", async () => | ||
function testCloseLastTroveReverts() public { | ||
priceFeed.setPrice(2000e18); | ||
openTroveNoHints100pctMaxFee(A, 100 ether, 100000e18, 1e17); | ||
|
||
// Artificially mint to Alice so she has enough to close her trove | ||
deal(address(boldToken), A, 100200e18); | ||
|
||
// Check she has more Bold than her trove debt | ||
uint256 aliceBal = boldToken.balanceOf(A); | ||
(uint256 aliceDebt,,,) = troveManager.getEntireDebtAndColl(A); | ||
assertGe(aliceBal, aliceDebt, "Not enough balance"); | ||
|
||
// check Recovery Mode | ||
checkRecoveryMode(false); | ||
|
||
// Alice attempts to close her trove | ||
vm.startPrank(A); | ||
vm.expectRevert("TroveManager: Only one trove in the system"); | ||
borrowerOperations.closeTrove(); | ||
vm.stopPrank(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.