We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d021fcc commit e444528Copy full SHA for e444528
tests/unitary/controller/test_create_loan.py
@@ -0,0 +1,19 @@
1
+import boa
2
+
3
+from tests.utils.constants import WAD
4
5
+BORROW_CAP = 10**9
6
+COLLATERAL = 10**21
7
+N_BANDS = 5
8
9
10
+def test_borrow_cap_reverts_when_exceeded(controller, collateral_token):
11
+ controller.eval(f"core.borrow_cap = {BORROW_CAP}")
12
+ controller.eval(f"core._total_debt.initial_debt = {BORROW_CAP}")
13
+ controller.eval(f"core._total_debt.rate_mul = {WAD}")
14
15
+ boa.deal(collateral_token, boa.env.eoa, COLLATERAL)
16
+ collateral_token.approve(controller, 2**256 - 1)
17
18
+ with boa.reverts("Borrow cap exceeded"):
19
+ controller.create_loan(COLLATERAL, 1, N_BANDS)
0 commit comments