Skip to content

Commit

Permalink
Update exchange test case
Browse files Browse the repository at this point in the history
  • Loading branch information
weiqiushi committed Jan 11, 2024
1 parent cc49084 commit 843e439
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test_exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ describe("Exchange", function () {
})

it("mint dmc", async () => {
await (await exchange.allowMintDMC(signers[0].address, "cookie1", ethers.parseEther("500"))).wait();
await (await exchange.allowMintDMC([signers[0].address], ["cookie1"], [ethers.parseEther("500")])).wait();

await expect(exchange.connect(signers[1]).allowMintDMC(signers[1].address, "cookie2", ethers.parseEther("1500"))).revertedWith("not mint admin");
await expect(exchange.connect(signers[1]).allowMintDMC([signers[1].address], ["cookie2"], [ethers.parseEther("1500")])).revertedWith("not mint admin");
await expect(exchange.connect(signers[1]).mintDMC("cookie1")).revertedWith("cannot mint");

await expect(exchange.mintDMC("cookie1")).changeTokenBalance(dmc, signers[0].address, ethers.parseEther("500"));

await expect(exchange.mintDMC("cookie1")).revertedWith("cannot mint");

await (await exchange.setMintAdmin(signers[1].address)).wait();
await (await exchange.connect(signers[1]).allowMintDMC(signers[1].address, "cookie2", ethers.parseEther("1000"))).wait();
await (await exchange.connect(signers[1]).allowMintDMC([signers[1].address], ["cookie2"], [ethers.parseEther("1000")])).wait();
await expect(exchange.connect(signers[1]).mintDMC("cookie2")).changeTokenBalance(dmc, signers[1].address, ethers.parseEther("1000"));
});

Expand Down

0 comments on commit 843e439

Please sign in to comment.