Skip to content

Commit

Permalink
Transfer unit tests for new token implementation (#2310)
Browse files Browse the repository at this point in the history
* remove nonreentrant modifiers from the toke code as they are not needed

* add setup for all account types

* check all relevant contract initial states

* add test between any possible contract accounts

* prettier

* add some documentation and prettier
  • Loading branch information
sparrowDom committed Nov 15, 2024
1 parent 727e4e9 commit 77d69f1
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion contracts/test/token/ousd.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { expect } = require("chai");
const { loadDefaultFixture } = require("../_fixture");
const { loadDefaultFixture, loadTokenTransferFixture } = require("../_fixture");
const { utils } = require("ethers");

const { daiUnits, ousdUnits, usdcUnits, isFork } = require("../helpers");
Expand Down Expand Up @@ -892,4 +892,22 @@ describe("Token", function () {
//A Should delegate to account B, rebase with profit, delegate to account C and all have correct balances
});
});

describe("Old code migrated contract accounts", function () {
beforeEach(async () => {
fixture = await loadTokenTransferFixture();
});

it("Old code auto migrated contract when calling rebase OptIn shouldn't affect invariables", async () => {
const {
nonrebase_cotract_notSet_altcpt_gt_0: contract_account,
ousd
} = fixture;

const nonRebasingSupply = await ousd.nonRebasingSupply();
await contract_account.rebaseOptIn();

await expect(nonRebasingSupply).to.equal(await ousd.nonRebasingSupply());
});
});
});

0 comments on commit 77d69f1

Please sign in to comment.