Skip to content

Commit

Permalink
test/unit: Add test case for invalid treasury cut rate value
Browse files Browse the repository at this point in the history
  • Loading branch information
victorges committed Mar 15, 2024
1 parent acea73f commit ead4ae0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/unit/BondingManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ describe("BondingManager", () => {
).to.be.revertedWith("caller must be Controller owner")
})

it("should fail if cut rate is not a valid precise perc", async () => {
const invalidPerc = math.precise.percPoints(
BigNumber.from(101),
100
)
await expect(
bondingManager
.connect(signers[2])
.setTreasuryRewardCutRate(invalidPerc)
).to.be.revertedWith("_cutRate is invalid precise percentage")
})

it("should set only nextRoundTreasuryRewardCutRate", async () => {
const tx = await bondingManager.setTreasuryRewardCutRate(FIFTY_PCT)
await expect(tx)
Expand Down

0 comments on commit ead4ae0

Please sign in to comment.