From 6d7bc45aee02128204fdd98e565f2ef35f34dfc0 Mon Sep 17 00:00:00 2001 From: Andres Aiello Date: Fri, 20 Oct 2023 13:31:55 -0300 Subject: [PATCH] fix test --- .../test/zeta-points/InvitationManager.ts | 3 ++- .../test/zeta-points/UserVerificationRegistry.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/zevm-app-contracts/test/zeta-points/InvitationManager.ts b/packages/zevm-app-contracts/test/zeta-points/InvitationManager.ts index 9477a080..4f5a84a7 100644 --- a/packages/zevm-app-contracts/test/zeta-points/InvitationManager.ts +++ b/packages/zevm-app-contracts/test/zeta-points/InvitationManager.ts @@ -18,6 +18,7 @@ describe("InvitationManager Contract test", () => { const InvitationManager = await ethers.getContractFactory("InvitationManager"); //@ts-ignore invitationManager = await InvitationManager.deploy(); + await invitationManager.markAsVerified(); }); describe("True", () => { @@ -51,7 +52,7 @@ describe("InvitationManager Contract test", () => { const sig = await getInvitationSig(inviter); await invitationManager.connect(invitee).confirmAndAcceptInvitation(inviter.address, sig); const tx = invitationManager.connect(invitee).confirmAndAcceptInvitation(inviter.address, sig); - await expect(tx).to.be.revertedWith("InvitationAlreadyAccepted"); + await expect(tx).to.be.revertedWith("UserAlreadyVerified"); }); it("Should count only for today if I just accepted", async () => { diff --git a/packages/zevm-app-contracts/test/zeta-points/UserVerificationRegistry.ts b/packages/zevm-app-contracts/test/zeta-points/UserVerificationRegistry.ts index 7bfa5ba3..edd75e32 100644 --- a/packages/zevm-app-contracts/test/zeta-points/UserVerificationRegistry.ts +++ b/packages/zevm-app-contracts/test/zeta-points/UserVerificationRegistry.ts @@ -4,16 +4,16 @@ use(solidity); import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; import { ethers } from "hardhat"; -import { UserVerificationRegistry } from "../../typechain-types"; +import { InvitationManager } from "../../typechain-types"; describe("UserVerificationRegistry Contract test", () => { - let userVerificationRegistry: UserVerificationRegistry, user: SignerWithAddress, addrs: SignerWithAddress[]; + let invitationManager: InvitationManager, user: SignerWithAddress, addrs: SignerWithAddress[]; beforeEach(async () => { [user, ...addrs] = await ethers.getSigners(); - const UserVerificationRegistryFactory = await ethers.getContractFactory("UserVerificationRegistry"); + const InvitationManagerFactory = await ethers.getContractFactory("InvitationManager"); //@ts-ignore - userVerificationRegistry = await UserVerificationRegistryFactory.deploy(); + invitationManager = await InvitationManagerFactory.deploy(); }); describe("True", () => { @@ -24,17 +24,17 @@ describe("UserVerificationRegistry Contract test", () => { describe("Vereification test", () => { it("Should be able to verify a wallet", async () => { - const hasBeenVerified = await userVerificationRegistry.hasBeenVerified(user.address); + const hasBeenVerified = await invitationManager.hasBeenVerified(user.address); expect(hasBeenVerified).to.be.false; - const tx = await userVerificationRegistry.markAsVerified(); + const tx = await invitationManager.markAsVerified(); const receipt = await tx.wait(); const block = await ethers.provider.getBlock(receipt.blockNumber); - const hasBeenVerifiedAfter = await userVerificationRegistry.hasBeenVerified(user.address); + const hasBeenVerifiedAfter = await invitationManager.hasBeenVerified(user.address); expect(hasBeenVerifiedAfter).to.be.true; - const verification = await userVerificationRegistry.getVerifiedTimestamp(user.address); + const verification = await invitationManager.getVerifiedTimestamp(user.address); expect(verification).to.be.eq(block.timestamp); }); });