Test that the new max supply doesn't impede pauses
An initial draft entangled emergencyPauseDeposit() and getMaxSupply(),
so I wanted a little more coverage for regressions.
@@ -330,17 +330,45 @@ describe("TBTCSystem", async function() {
})
it("pauses new deposit creation", async () => {
+ let allowNewDeposits = await tbtcSystem.getAllowNewDeposits()
+ expect(allowNewDeposits).to.equal(true)
+
await tbtcSystem.emergencyPauseNewDeposits()
- const allowNewDeposits = await tbtcSystem.getAllowNewDeposits()
+ allowNewDeposits = await tbtcSystem.getAllowNewDeposits()
expect(allowNewDeposits).to.equal(false)
})
- it("pauses new deposit creation after the 1-day grace period", async () => {
+ it("pauses new deposit creation a day out", async () => {
+ let allowNewDeposits = await tbtcSystem.getAllowNewDeposits()
+ expect(allowNewDeposits).to.equal(true)
+
await increaseTime(24 * 60 * 60 + 1)
await tbtcSystem.emergencyPauseNewDeposits()
- const allowNewDeposits = await tbtcSystem.getAllowNewDeposits()
+ allowNewDeposits = await tbtcSystem.getAllowNewDeposits()
+ expect(allowNewDeposits).to.equal(false)
+ })
+
+ it("pauses new deposit creation 31 days out", async () => {
+ let allowNewDeposits = await tbtcSystem.getAllowNewDeposits()
+ expect(allowNewDeposits).to.equal(true)
+
+ await increaseTime(31 * 24 * 60 * 60 + 1)
+ await tbtcSystem.emergencyPauseNewDeposits()
+
+ allowNewDeposits = await tbtcSystem.getAllowNewDeposits()
+ expect(allowNewDeposits).to.equal(false)
+ })
+
+ it("pauses new deposit creation 61 days out", async () => {
+ let allowNewDeposits = await tbtcSystem.getAllowNewDeposits()
+ expect(allowNewDeposits).to.equal(true)
+
+ await increaseTime(61 * 24 * 60 * 60 + 1)
+ await tbtcSystem.emergencyPauseNewDeposits()
+
+ allowNewDeposits = await tbtcSystem.getAllowNewDeposits()
expect(allowNewDeposits).to.equal(false)
})
