Skip to content

Commit

Permalink
test(Foundry): finish tests
Browse files Browse the repository at this point in the history
  • Loading branch information
parv3213 committed Jan 7, 2022
1 parent 8f0a871 commit 479bfb5
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions test/contracts/Foundry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,17 +367,26 @@ const setup = async () => {
expect(meTokenRegistryDetails.balancePooled).to.be.gt(0);
});
it("balanceLocked = 0, ending supply > 0, owner", async () => {
// mint some to buyer
// burn all owner shares
await foundry
.connect(account1)
.mint(meToken.address, tokenDeposited, account1.address);
.connect(account2)
.burn(
meToken.address,
await meToken.balanceOf(account2.address),
account2.address
);

// burn owner shares
// mint some to owner
await foundry
.connect(account2)
.mint(meToken.address, tokenDeposited, account2.address);

// burn some owner shares
await foundry
.connect(account2)
.burn(
meToken.address,
await meToken.balanceOf(account2.address),
(await meToken.balanceOf(account2.address)).div(2),
account2.address
);

Expand All @@ -389,6 +398,20 @@ const setup = async () => {
expect(meTokenRegistryDetails.balancePooled).to.be.gt(0);
});
it("balanceLocked > 0, ending supply = 0, owner", async () => {
// burn from buyer
await foundry
.connect(account2)
.burn(
meToken.address,
await meToken.balanceOf(account2.address),
account2.address
);

// mint some to buyer
await foundry
.connect(account1)
.mint(meToken.address, tokenDeposited, account1.address);

// burn from buyer
await foundry
.connect(account1)
Expand Down

0 comments on commit 479bfb5

Please sign in to comment.