Added gevernance test case to check duplicated finalization
If update finalization is called twice the request should be rejected.
It is required that a new update is initiated first.
It is a common case for updates so moved the case from just factory
updates test to common governance test.
@@ -219,23 +219,6 @@ describe("TBTCSystem governance", async function() {
"beginKeepFactoriesUpdate can only be called within 180 days of initialization",
)
})
-
- it("reverts if finalizeKeepFactoriesUpdate is called twice", async () => {
- await tbtcSystem.beginKeepFactoriesUpdate(
- "0x0000000000000000000000000000000000000001",
- "0x0000000000000000000000000000000000000002",
- "0x0000000000000000000000000000000000000003",
- )
-
- const finalizationTime = await tbtcSystem.getRemainingKeepFactoriesUpdateTime()
- await increaseTime(finalizationTime.toNumber() + 1) // 10 days
- await tbtcSystem.finalizeKeepFactoriesUpdate()
-
- await expectRevert(
- tbtcSystem.finalizeKeepFactoriesUpdate(),
- "Change not initiated",
- )
- })
})
before(async () => {
@@ -751,6 +734,15 @@ describe("TBTCSystem governance", async function() {
await invoke("begin", "", goodParameters)
})
+
+ it("reverts if finalizing a change twice", async () => {
+ await invoke("begin", "", goodParameters)
+ const remainingTime = await invoke("getRemaining", "Time")
+ await increaseTime(remainingTime.toNumber() + 1)
+ await invoke("finalize")
+
+ await expectRevert(invoke("finalize"), "Change not initiated.")
+ })
})
})
}
