semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Make the contract tests more atomic and use `loadFixture`

Open vplasencia opened this issue 1 year ago • 5 comments

Description

It would be nice to make the tests as atomic as possible and use loadFixture.

This can help: https://github.com/semaphore-protocol/semaphore/blob/main/packages/cli-template-contracts-hardhat/test/Feedback.ts

vplasencia avatar Mar 14 '24 17:03 vplasencia

Hi, I would like to take on this issue! :)

0hwc avatar May 02 '24 08:05 0hwc

Hey @waddaboo yes, sure. Do you want me to assign you this issue?

vplasencia avatar May 02 '24 08:05 vplasencia

Yes, please. Thanks!

0hwc avatar May 02 '24 09:05 0hwc

@waddaboo done. Please, let us know if you have any questions.

vplasencia avatar May 02 '24 09:05 vplasencia

Hi @vplasencia, I'm currently facing an issue at the Should not verify a proof if the Merkle tree root is expired test.

I have created a new group with 0-1s expiry with createGroup(address,uint256), and when I test it with verifyProof, it returns true instead of the Semaphore_MerkleTreeRootIsExpired error.

I have tried using setTimeOut to wait out the expiration and @nomicfoundation/hardhat-toolbox/network-helpers's time helpers to advance the block timestamp but still not getting the expected return.

Any ideas on how to work around this?

Edit: Nvm, found the error 😅

0hwc avatar May 06 '24 09:05 0hwc