Closed mhchia closed 3 years ago
This turns out to be my own fault due to the cache of the result from successfulSMPMessagesFactory
. In every proofOfSMPInputsFactory
call, keypairC.pubKey
is generated randomly and is passed to successfulSMPMessagesFactory
as the secret
. However, I made the result from proofOfSMPInputsFactory
as a singleton, and thus every successfulSMPMessagesFactory
always returns the same result as the first call to the function. This is wrong because SMP messages should be calculated again whenever the secret is changed. Shout out to @NIC619 for discussing w/ me and giving me the direction of debugging.
However, the reason why it didn't fail when I used tsdx is still interesting. For example, in commit https://github.com/mhchia/blind-find/commit/c8b4573481c770ed761d25d99a058f64d211d44a the tests are run successfully. One guess is each test file is run independently and thus the cache is not used at all in tsdx. This should be investigated further.
Our tests began failing after we switch to hardhat. It seems
proofOfSMP.test.ts
conflicts withgenProof.test.ts
. ~I'm guessing it's related to circom or~ the different behavior between jest and mocha. Skip it for now since the logic inside is tested ingenProof.test.ts
. Error message is here