From cdbbd20c9bf28e2408c7fa732480e4c6d908ad50 Mon Sep 17 00:00:00 2001 From: proxima424 Date: Fri, 13 Oct 2023 17:20:09 +0530 Subject: [PATCH] Added additional checks --- test/Smart-Account-Factory.specs.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/Smart-Account-Factory.specs.ts b/test/Smart-Account-Factory.specs.ts index 9d5a582b..51138285 100644 --- a/test/Smart-Account-Factory.specs.ts +++ b/test/Smart-Account-Factory.specs.ts @@ -116,11 +116,15 @@ describe("Smart Account Factory", async () => { const stakeAmount = ethers.utils.parseEther("1.234256"); const validUnstakeDelay = 600; const invalidEPAddress = AddressZero; + const depositInfo = await entryPoint.getDepositInfo( + smartAccountFactory.address + ); await expect( smartAccountFactory.addStake(invalidEPAddress, validUnstakeDelay, { value: stakeAmount, }) ).to.be.revertedWith("Invalid EP address"); + expect(depositInfo.stake).to.be.equal(0); }); it("reverts when unstake delay not specified", async () => { @@ -128,6 +132,9 @@ describe("Smart Account Factory", async () => { await setupTests(); const stakeAmount = ethers.utils.parseEther("1.234256"); const invalidUnstakeDelay = 0; + const depositInfo = await entryPoint.getDepositInfo( + smartAccountFactory.address + ); await expect( smartAccountFactory.addStake( entryPoint.address, @@ -135,6 +142,7 @@ describe("Smart Account Factory", async () => { { value: stakeAmount } ) ).to.be.revertedWith("must specify unstake delay"); + expect(depositInfo.stake).to.be.equal(0); }); it("reverts when trying to decrease unstake time", async () => { @@ -157,6 +165,7 @@ describe("Smart Account Factory", async () => { { value: stakeAmount } ) ).to.be.revertedWith("cannot decrease unstake time"); + expect(depositInfo.unstakeDelaySec).to.be.equal(validUnstakeDelay); }); it("reverts when stake value not specified", async () => {