Skip to content

Commit 3e28524

Browse files
add additional sanity checks
1 parent b1df47d commit 3e28524

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/unit/BondingManager.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6170,6 +6170,41 @@ describe("BondingManager", () => {
61706170
)
61716171
})
61726172

6173+
it("should fail if system is paused", async () => {
6174+
await bondingManager
6175+
.connect(transcoder)
6176+
.setRewardCaller(nonTranscoder.address)
6177+
6178+
await fixture.controller.pause()
6179+
const setRewardCallerTx = bondingManager
6180+
.connect(transcoder)
6181+
.setRewardCaller(nonTranscoder.address)
6182+
await expect(setRewardCallerTx).to.be.revertedWith(
6183+
"system is paused"
6184+
)
6185+
6186+
const rewardTx = bondingManager
6187+
.connect(nonTranscoder)
6188+
.rewardForTranscoder(transcoder.address)
6189+
await expect(rewardTx).to.be.revertedWith("system is paused")
6190+
})
6191+
6192+
it("should fail if current round is not initialized", async () => {
6193+
await bondingManager
6194+
.connect(transcoder)
6195+
.setRewardCaller(nonTranscoder.address)
6196+
await fixture.roundsManager.setMockBool(
6197+
functionSig("currentRoundInitialized()"),
6198+
false
6199+
)
6200+
const rewardTx = bondingManager
6201+
.connect(nonTranscoder)
6202+
.rewardForTranscoder(transcoder.address)
6203+
await expect(rewardTx).to.be.revertedWith(
6204+
"current round is not initialized"
6205+
)
6206+
})
6207+
61736208
it("should always checkpoint the reward recipient, not the RewardCaller", async () => {
61746209
await bondingManager
61756210
.connect(transcoder)

0 commit comments

Comments
 (0)