Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ihoroleksiienko committed Jul 5, 2024
1 parent f1e4534 commit b1574ff
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/base/CWToken.complex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,24 @@ describe("Contract 'CWToken' - Premintable, Freezable & Restrictable scenarios",
});

it("Transfer to non-purpose account - test 10", async () => {
const { token } = await setUpFixture(deployAndConfigureToken);
await proveTx(token.enableBlocklist(true));
await proveTx(token.setMainBlocklister(blocklister));
await proveTx(token.mint(user.address, 20));
await proveTx(token.freeze(user.address, 10));
await proveTx(token.restrictionIncrease(user.address, PURPOSE, 5));
await expect(
connect(token, blocklister).transferFrozen(user, nonPurposeAccount.address, 10)
).to.changeTokenBalances(
token,
[user, nonPurposeAccount],
[-10, 10]
);
expect(await token.balanceOfFrozen(user.address)).to.eq(0);
expect(await token.balanceOfRestricted(user.address, PURPOSE)).to.eq(5);
});

it("Transfer to non-purpose account - test 10 if restricted greater", async () => {
const { token } = await setUpFixture(deployAndConfigureToken);
await proveTx(token.enableBlocklist(true));
await proveTx(token.setMainBlocklister(blocklister));
Expand Down

0 comments on commit b1574ff

Please # to comment.