From d8a9435fa70e87f226f62f2883f71cf8b6fd0fc3 Mon Sep 17 00:00:00 2001 From: rymnc <43716372+rymnc@users.noreply.github.com> Date: Thu, 30 Mar 2023 20:28:04 +0530 Subject: [PATCH] fix: hardhat tests --- test/rln.test.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/rln.test.ts b/test/rln.test.ts index f7b882d..21c9a47 100644 --- a/test/rln.test.ts +++ b/test/rln.test.ts @@ -29,7 +29,7 @@ describe("RLN", () => { ); }); - it("should withdraw membership", async () => { + it("should slash membership", async () => { const rln = await ethers.getContract("RLN", ethers.provider.getSigner(0)); const price = await rln.MEMBERSHIP_DEPOSIT(); @@ -45,21 +45,21 @@ describe("RLN", () => { }); await registerTx.wait(); - // We withdraw our id_commitment + // We slash the id_commitment const receiverAddress = "0x000000000000000000000000000000000000dead"; - const withdrawTx = await rln["withdraw(uint256,address)"]( + const slashTx = await rln["slash(uint256,address)"]( idSecret, receiverAddress ); - const txWithdrawReceipt = await withdrawTx.wait(); + const slashTxReceipt = await slashTx.wait(); - const withdrawalPk = txWithdrawReceipt.events[0].args.idCommitment; + const slashedIdCommitment = slashTxReceipt.events[0].args.idCommitment; // We ensure the registered id_commitment is the one we passed and that the index is the same expect( - withdrawalPk.toHexString() === idCommitment, - "withdraw commitment doesn't match registered commitment" + slashedIdCommitment.toHexString() === idCommitment, + "slashed commitment doesn't match registered commitment" ); });