Skip to content

Commit

Permalink
Unit test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
naddison36 committed Nov 7, 2024
1 parent 17f121c commit 381d13d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions contracts/test/token/ousd.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ describe("Token", function () {

const creditsAdded = ousdUnits("99.50")
.mul(rebasingCreditsPerTokenHighres)
.div(utils.parseUnits("1", 18));
.div(utils.parseUnits("1", 18))
.add(1);

await expect(rebasingCredits).to.equal(
initialRebasingCredits.add(creditsAdded)
Expand Down Expand Up @@ -500,30 +501,30 @@ describe("Token", function () {
it("Should not allow EOA to call rebaseOptIn when already opted in to rebasing", async () => {
let { ousd, matt } = fixture;
await expect(ousd.connect(matt).rebaseOptIn()).to.be.revertedWith(
"Account has not opted out"
"Account must be non-rebasing"
);
});

it("Should not allow EOA to call rebaseOptOut when already opted out of rebasing", async () => {
let { ousd, matt } = fixture;
await ousd.connect(matt).rebaseOptOut();
await expect(ousd.connect(matt).rebaseOptOut()).to.be.revertedWith(
"Account has not opted in"
"Only standard rebasing accounts can opt out"
);
});

it("Should not allow contract to call rebaseOptIn when already opted in to rebasing", async () => {
let { mockNonRebasing } = fixture;
await mockNonRebasing.rebaseOptIn();
await expect(mockNonRebasing.rebaseOptIn()).to.be.revertedWith(
"Account has not opted out"
"Account must be non-rebasing"
);
});

it("Should not allow contract to call rebaseOptOut when already opted out of rebasing", async () => {
let { mockNonRebasing } = fixture;
await expect(mockNonRebasing.rebaseOptOut()).to.be.revertedWith(
"Account has not opted in"
"Account must be rebasing"
);
});

Expand Down

0 comments on commit 381d13d

Please sign in to comment.