@maci-protocol/testing 0.0.0-ci.71ed5ba → 0.0.0-ci.75198a9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/LICENSE +1 -2
  2. package/build/ts/__tests__/e2e.full.test.d.ts +2 -0
  3. package/build/ts/__tests__/e2e.full.test.d.ts.map +1 -0
  4. package/build/ts/__tests__/e2e.full.test.js +845 -0
  5. package/build/ts/__tests__/e2e.full.test.js.map +1 -0
  6. package/build/ts/__tests__/e2e.nonQv.test.js +412 -25
  7. package/build/ts/__tests__/e2e.nonQv.test.js.map +1 -1
  8. package/build/ts/__tests__/e2e.test.js +98 -108
  9. package/build/ts/__tests__/e2e.test.js.map +1 -1
  10. package/build/ts/__tests__/integration.test.js +35 -35
  11. package/build/ts/__tests__/integration.test.js.map +1 -1
  12. package/build/ts/__tests__/keyChange.test.js +38 -40
  13. package/build/ts/__tests__/keyChange.test.js.map +1 -1
  14. package/build/ts/__tests__/maciKeys.test.js +39 -39
  15. package/build/ts/__tests__/maciKeys.test.js.map +1 -1
  16. package/build/ts/__tests__/unit/joinPoll.test.js +61 -25
  17. package/build/ts/__tests__/unit/joinPoll.test.js.map +1 -1
  18. package/build/ts/__tests__/unit/poll.test.js +7 -6
  19. package/build/ts/__tests__/unit/poll.test.js.map +1 -1
  20. package/build/ts/__tests__/unit/publish.test.js +7 -6
  21. package/build/ts/__tests__/unit/publish.test.js.map +1 -1
  22. package/build/ts/__tests__/unit/setVerifyingKeys.test.d.ts +2 -0
  23. package/build/ts/__tests__/unit/setVerifyingKeys.test.d.ts.map +1 -0
  24. package/build/ts/__tests__/unit/setVerifyingKeys.test.js +52 -0
  25. package/build/ts/__tests__/unit/setVerifyingKeys.test.js.map +1 -0
  26. package/build/ts/__tests__/unit/signup.test.js +4 -4
  27. package/build/ts/__tests__/unit/signup.test.js.map +1 -1
  28. package/build/ts/__tests__/unit/utils.test.js +12 -12
  29. package/build/ts/__tests__/unit/utils.test.js.map +1 -1
  30. package/build/ts/constants.d.ts +49 -51
  31. package/build/ts/constants.d.ts.map +1 -1
  32. package/build/ts/constants.js +107 -73
  33. package/build/ts/constants.js.map +1 -1
  34. package/build/ts/testingClass.d.ts +7 -7
  35. package/build/ts/testingClass.d.ts.map +1 -1
  36. package/build/ts/testingClass.js +24 -22
  37. package/build/ts/testingClass.js.map +1 -1
  38. package/build/ts/types.d.ts +11 -11
  39. package/build/ts/types.d.ts.map +1 -1
  40. package/build/ts/utils.d.ts +3 -3
  41. package/build/ts/utils.d.ts.map +1 -1
  42. package/build/ts/utils.js +12 -12
  43. package/build/ts/utils.js.map +1 -1
  44. package/build/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +14 -13
@@ -27,38 +27,39 @@ describe("e2e tests", function test() {
27
27
  const useWasm = (0, sdk_1.isArm)();
28
28
  this.timeout(900000);
29
29
  let maciAddresses;
30
- let vkRegistryAddress;
30
+ let verifyingKeysRegistryAddress;
31
31
  let initialVoiceCreditProxyContractAddress;
32
32
  let verifierContractAddress;
33
33
  let signer;
34
34
  const generateProofsArgs = {
35
35
  outputDir: constants_1.testProofsDirPath,
36
36
  tallyFile: constants_1.testTallyFilePath,
37
- tallyZkey: constants_1.tallyVotesTestZkeyPath,
38
- processZkey: constants_1.processMessageTestZkeyPath,
37
+ voteTallyZkey: constants_1.testTallyVotesZkeyPath,
38
+ messageProcessorZkey: constants_1.testProcessMessageZkeyPath,
39
39
  pollId: 0n,
40
40
  rapidsnark: constants_1.testRapidsnarkPath,
41
- processWitgen: constants_1.testProcessMessagesWitnessPath,
42
- processDatFile: constants_1.testProcessMessagesWitnessDatPath,
43
- tallyWitgen: constants_1.testTallyVotesWitnessPath,
44
- tallyDatFile: constants_1.testTallyVotesWitnessDatPath,
41
+ messageProcessorWitnessGenerator: constants_1.testProcessMessagesWitnessPath,
42
+ messageProcessorWitnessDatFile: constants_1.testProcessMessagesWitnessDatPath,
43
+ voteTallyWitnessGenerator: constants_1.testTallyVotesWitnessPath,
44
+ voteTallyWitnessDatFile: constants_1.testTallyVotesWitnessDatPath,
45
45
  coordinatorPrivateKey: constants_1.coordinatorPrivateKey,
46
- processWasm: constants_1.testProcessMessagesWasmPath,
47
- tallyWasm: constants_1.testTallyVotesWasmPath,
46
+ messageProcessorWasm: constants_1.testProcessMessagesWasmPath,
47
+ voteTallyWasm: constants_1.testTallyVotesWasmPath,
48
48
  useWasm,
49
- useQuadraticVoting: true,
49
+ mode: core_1.EMode.QV,
50
50
  };
51
- // before all tests we deploy the vk registry contract and set the verifying keys
51
+ // before all tests we deploy the verifying keys registry contract and set the verifying keys
52
52
  before(async () => {
53
53
  signer = await (0, sdk_1.getDefaultSigner)();
54
- // we deploy the vk registry contract
55
- vkRegistryAddress = await (0, sdk_1.deployVkRegistryContract)({ signer });
56
- const [initialVoiceCreditProxy] = await (0, sdk_1.deployConstantInitialVoiceCreditProxy)({ amount: constants_1.DEFAULT_INITIAL_VOICE_CREDITS }, signer, undefined, true);
54
+ // we deploy the verifying keys registry contract
55
+ verifyingKeysRegistryAddress = await (0, sdk_1.deployVerifyingKeysRegistryContract)({ signer });
56
+ const constantInitialVoiceCreditProxyFactory = await (0, sdk_1.deployConstantInitialVoiceCreditProxyFactory)(signer, true);
57
+ const initialVoiceCreditProxy = await (0, sdk_1.deployConstantInitialVoiceCreditProxy)({ amount: constants_1.DEFAULT_INITIAL_VOICE_CREDITS }, constantInitialVoiceCreditProxyFactory, signer);
57
58
  initialVoiceCreditProxyContractAddress = await initialVoiceCreditProxy.getAddress();
58
59
  const verifier = await (0, sdk_1.deployVerifier)(signer, true);
59
60
  verifierContractAddress = await verifier.getAddress();
60
61
  // we set the verifying keys
61
- await (0, sdk_1.setVerifyingKeys)({ ...(await (0, constants_1.verifyingKeysArgs)(signer)), vkRegistryAddress });
62
+ await (0, sdk_1.setVerifyingKeys)({ ...(await (0, constants_1.verifyingKeysArgs)(signer)), verifyingKeysRegistryAddress });
62
63
  });
63
64
  describe("2 signups (1 after stateAq is merged and logs are fetched), 1 message", () => {
64
65
  after(async () => {
@@ -86,7 +87,7 @@ describe("e2e tests", function test() {
86
87
  relayers: [await signer.getAddress()],
87
88
  maciAddress: maciAddresses.maciContractAddress,
88
89
  verifierContractAddress,
89
- vkRegistryContractAddress: vkRegistryAddress,
90
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
90
91
  policyContractAddress: pollPolicyContractAddress,
91
92
  initialVoiceCreditProxyContractAddress,
92
93
  });
@@ -103,12 +104,11 @@ describe("e2e tests", function test() {
103
104
  await (0, sdk_1.joinPoll)({
104
105
  maciAddress: maciAddresses.maciContractAddress,
105
106
  privateKey: user.privateKey.serialize(),
106
- stateIndex: 1n,
107
107
  pollId: 0n,
108
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
108
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
109
109
  useWasm: true,
110
110
  pollWasm: constants_1.testPollJoiningWasmPath,
111
- pollWitgen: constants_1.testPollJoiningWitnessPath,
111
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
112
112
  rapidsnark: constants_1.testRapidsnarkPath,
113
113
  sgDataArg: constants_1.DEFAULT_SG_DATA,
114
114
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -124,7 +124,7 @@ describe("e2e tests", function test() {
124
124
  pollId: 0n,
125
125
  newVoteWeight: 9n,
126
126
  maciAddress: maciAddresses.maciContractAddress,
127
- salt: (0, crypto_1.genRandomSalt)(),
127
+ salt: (0, crypto_1.generateRandomSalt)(),
128
128
  privateKey: user.privateKey.serialize(),
129
129
  signer,
130
130
  });
@@ -177,7 +177,7 @@ describe("e2e tests", function test() {
177
177
  relayers: [await signer.getAddress()],
178
178
  maciAddress: maciAddresses.maciContractAddress,
179
179
  verifierContractAddress,
180
- vkRegistryContractAddress: vkRegistryAddress,
180
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
181
181
  policyContractAddress: pollPolicyContractAddress,
182
182
  initialVoiceCreditProxyContractAddress,
183
183
  });
@@ -201,12 +201,11 @@ describe("e2e tests", function test() {
201
201
  await (0, sdk_1.joinPoll)({
202
202
  maciAddress: maciAddresses.maciContractAddress,
203
203
  privateKey: users[i].privateKey.serialize(),
204
- stateIndex: BigInt(i + 1),
205
204
  pollId: 0n,
206
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
205
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
207
206
  useWasm: true,
208
207
  pollWasm: constants_1.testPollJoiningWasmPath,
209
- pollWitgen: constants_1.testPollJoiningWitnessPath,
208
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
210
209
  rapidsnark: constants_1.testRapidsnarkPath,
211
210
  sgDataArg: constants_1.DEFAULT_SG_DATA,
212
211
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -223,7 +222,7 @@ describe("e2e tests", function test() {
223
222
  pollId: 0n,
224
223
  newVoteWeight: 4n,
225
224
  maciAddress: maciAddresses.maciContractAddress,
226
- salt: (0, crypto_1.genRandomSalt)(),
225
+ salt: (0, crypto_1.generateRandomSalt)(),
227
226
  privateKey: users[0].privateKey.serialize(),
228
227
  signer,
229
228
  });
@@ -235,7 +234,7 @@ describe("e2e tests", function test() {
235
234
  pollId: 0n,
236
235
  newVoteWeight: 3n,
237
236
  maciAddress: maciAddresses.maciContractAddress,
238
- salt: (0, crypto_1.genRandomSalt)(),
237
+ salt: (0, crypto_1.generateRandomSalt)(),
239
238
  privateKey: users[0].privateKey.serialize(),
240
239
  signer,
241
240
  });
@@ -247,7 +246,7 @@ describe("e2e tests", function test() {
247
246
  pollId: 0n,
248
247
  newVoteWeight: 9n,
249
248
  maciAddress: maciAddresses.maciContractAddress,
250
- salt: (0, crypto_1.genRandomSalt)(),
249
+ salt: (0, crypto_1.generateRandomSalt)(),
251
250
  privateKey: users[0].privateKey.serialize(),
252
251
  signer,
253
252
  });
@@ -259,7 +258,7 @@ describe("e2e tests", function test() {
259
258
  pollId: 0n,
260
259
  newVoteWeight: 9n,
261
260
  maciAddress: maciAddresses.maciContractAddress,
262
- salt: (0, crypto_1.genRandomSalt)(),
261
+ salt: (0, crypto_1.generateRandomSalt)(),
263
262
  privateKey: users[1].privateKey.serialize(),
264
263
  signer,
265
264
  });
@@ -271,7 +270,7 @@ describe("e2e tests", function test() {
271
270
  pollId: 0n,
272
271
  newVoteWeight: 9n,
273
272
  maciAddress: maciAddresses.maciContractAddress,
274
- salt: (0, crypto_1.genRandomSalt)(),
273
+ salt: (0, crypto_1.generateRandomSalt)(),
275
274
  privateKey: users[2].privateKey.serialize(),
276
275
  signer,
277
276
  });
@@ -283,7 +282,7 @@ describe("e2e tests", function test() {
283
282
  pollId: 0n,
284
283
  newVoteWeight: 3n,
285
284
  maciAddress: maciAddresses.maciContractAddress,
286
- salt: (0, crypto_1.genRandomSalt)(),
285
+ salt: (0, crypto_1.generateRandomSalt)(),
287
286
  privateKey: users[3].privateKey.serialize(),
288
287
  signer,
289
288
  });
@@ -295,7 +294,7 @@ describe("e2e tests", function test() {
295
294
  pollId: 0n,
296
295
  newVoteWeight: 2n,
297
296
  maciAddress: maciAddresses.maciContractAddress,
298
- salt: (0, crypto_1.genRandomSalt)(),
297
+ salt: (0, crypto_1.generateRandomSalt)(),
299
298
  privateKey: users[3].privateKey.serialize(),
300
299
  signer,
301
300
  });
@@ -307,7 +306,7 @@ describe("e2e tests", function test() {
307
306
  pollId: 0n,
308
307
  newVoteWeight: 9n,
309
308
  maciAddress: maciAddresses.maciContractAddress,
310
- salt: (0, crypto_1.genRandomSalt)(),
309
+ salt: (0, crypto_1.generateRandomSalt)(),
311
310
  privateKey: users[3].privateKey.serialize(),
312
311
  signer,
313
312
  });
@@ -317,7 +316,7 @@ describe("e2e tests", function test() {
317
316
  {
318
317
  pollId: 0n,
319
318
  voteOptionIndex: 1n,
320
- salt: (0, crypto_1.genRandomSalt)(),
319
+ salt: (0, crypto_1.generateRandomSalt)(),
321
320
  nonce: 2n,
322
321
  privateKey: users[0].privateKey,
323
322
  stateIndex: 1n,
@@ -329,7 +328,7 @@ describe("e2e tests", function test() {
329
328
  {
330
329
  pollId: 0n,
331
330
  voteOptionIndex: 1n,
332
- salt: (0, crypto_1.genRandomSalt)(),
331
+ salt: (0, crypto_1.generateRandomSalt)(),
333
332
  nonce: 2n,
334
333
  privateKey: users[0].privateKey,
335
334
  stateIndex: 1n,
@@ -341,7 +340,7 @@ describe("e2e tests", function test() {
341
340
  {
342
341
  pollId: 0n,
343
342
  voteOptionIndex: 1n,
344
- salt: (0, crypto_1.genRandomSalt)(),
343
+ salt: (0, crypto_1.generateRandomSalt)(),
345
344
  nonce: 1n,
346
345
  privateKey: users[0].privateKey,
347
346
  stateIndex: 1n,
@@ -353,7 +352,7 @@ describe("e2e tests", function test() {
353
352
  {
354
353
  pollId: 0n,
355
354
  voteOptionIndex: 1n,
356
- salt: (0, crypto_1.genRandomSalt)(),
355
+ salt: (0, crypto_1.generateRandomSalt)(),
357
356
  nonce: 1n,
358
357
  privateKey: users[1].privateKey,
359
358
  stateIndex: 2n,
@@ -365,7 +364,7 @@ describe("e2e tests", function test() {
365
364
  {
366
365
  pollId: 0n,
367
366
  voteOptionIndex: 1n,
368
- salt: (0, crypto_1.genRandomSalt)(),
367
+ salt: (0, crypto_1.generateRandomSalt)(),
369
368
  nonce: 1n,
370
369
  privateKey: users[2].privateKey,
371
370
  stateIndex: 3n,
@@ -377,7 +376,7 @@ describe("e2e tests", function test() {
377
376
  {
378
377
  pollId: 0n,
379
378
  voteOptionIndex: 0n,
380
- salt: (0, crypto_1.genRandomSalt)(),
379
+ salt: (0, crypto_1.generateRandomSalt)(),
381
380
  nonce: 3n,
382
381
  privateKey: users[3].privateKey,
383
382
  stateIndex: 4n,
@@ -389,7 +388,7 @@ describe("e2e tests", function test() {
389
388
  {
390
389
  pollId: 0n,
391
390
  voteOptionIndex: 0n,
392
- salt: (0, crypto_1.genRandomSalt)(),
391
+ salt: (0, crypto_1.generateRandomSalt)(),
393
392
  nonce: 2n,
394
393
  privateKey: users[3].privateKey,
395
394
  stateIndex: 4n,
@@ -401,7 +400,7 @@ describe("e2e tests", function test() {
401
400
  {
402
401
  pollId: 0n,
403
402
  voteOptionIndex: 0n,
404
- salt: (0, crypto_1.genRandomSalt)(),
403
+ salt: (0, crypto_1.generateRandomSalt)(),
405
404
  nonce: 1n,
406
405
  privateKey: users[3].privateKey,
407
406
  stateIndex: 4n,
@@ -462,7 +461,7 @@ describe("e2e tests", function test() {
462
461
  relayers: [await signer.getAddress()],
463
462
  maciAddress: maciAddresses.maciContractAddress,
464
463
  verifierContractAddress,
465
- vkRegistryContractAddress: vkRegistryAddress,
464
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
466
465
  policyContractAddress: pollPolicyContractAddress,
467
466
  initialVoiceCreditProxyContractAddress,
468
467
  });
@@ -483,12 +482,11 @@ describe("e2e tests", function test() {
483
482
  await (0, sdk_1.joinPoll)({
484
483
  maciAddress: maciAddresses.maciContractAddress,
485
484
  privateKey: users[0].privateKey.serialize(),
486
- stateIndex: 1n,
487
485
  pollId: 0n,
488
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
486
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
489
487
  useWasm: true,
490
488
  pollWasm: constants_1.testPollJoiningWasmPath,
491
- pollWitgen: constants_1.testPollJoiningWitnessPath,
489
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
492
490
  rapidsnark: constants_1.testRapidsnarkPath,
493
491
  sgDataArg: constants_1.DEFAULT_SG_DATA,
494
492
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -501,7 +499,7 @@ describe("e2e tests", function test() {
501
499
  .map(() => (0, sdk_1.generateVote)({
502
500
  pollId: 0n,
503
501
  voteOptionIndex: 0n,
504
- salt: (0, crypto_1.genRandomSalt)(),
502
+ salt: (0, crypto_1.generateRandomSalt)(),
505
503
  nonce: 1n,
506
504
  privateKey: users[0].privateKey,
507
505
  stateIndex: 1n,
@@ -528,7 +526,7 @@ describe("e2e tests", function test() {
528
526
  pollId: 0n,
529
527
  newVoteWeight: 9n,
530
528
  maciAddress: maciAddresses.maciContractAddress,
531
- salt: (0, crypto_1.genRandomSalt)(),
529
+ salt: (0, crypto_1.generateRandomSalt)(),
532
530
  privateKey: users[0].privateKey.serialize(),
533
531
  signer,
534
532
  });
@@ -574,7 +572,7 @@ describe("e2e tests", function test() {
574
572
  relayers: [await signer.getAddress()],
575
573
  maciAddress: maciAddresses.maciContractAddress,
576
574
  verifierContractAddress,
577
- vkRegistryContractAddress: vkRegistryAddress,
575
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
578
576
  policyContractAddress: pollPolicyContractAddress,
579
577
  initialVoiceCreditProxyContractAddress,
580
578
  });
@@ -598,12 +596,11 @@ describe("e2e tests", function test() {
598
596
  await (0, sdk_1.joinPoll)({
599
597
  maciAddress: maciAddresses.maciContractAddress,
600
598
  privateKey: users[i].privateKey.serialize(),
601
- stateIndex: BigInt(i + 1),
602
599
  pollId: 0n,
603
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
600
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
604
601
  useWasm: true,
605
602
  pollWasm: constants_1.testPollJoiningWasmPath,
606
- pollWitgen: constants_1.testPollJoiningWitnessPath,
603
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
607
604
  rapidsnark: constants_1.testRapidsnarkPath,
608
605
  sgDataArg: constants_1.DEFAULT_SG_DATA,
609
606
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -623,7 +620,7 @@ describe("e2e tests", function test() {
623
620
  nonce: 1n,
624
621
  pollId: 0n,
625
622
  newVoteWeight: 9n,
626
- salt: (0, crypto_1.genRandomSalt)(),
623
+ salt: (0, crypto_1.generateRandomSalt)(),
627
624
  privateKey: users[i].privateKey.serialize(),
628
625
  signer,
629
626
  });
@@ -667,7 +664,7 @@ describe("e2e tests", function test() {
667
664
  relayers: [await signer.getAddress()],
668
665
  maciAddress: maciAddresses.maciContractAddress,
669
666
  verifierContractAddress,
670
- vkRegistryContractAddress: vkRegistryAddress,
667
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
671
668
  policyContractAddress: pollPolicyContractAddress,
672
669
  initialVoiceCreditProxyContractAddress,
673
670
  });
@@ -691,12 +688,11 @@ describe("e2e tests", function test() {
691
688
  await (0, sdk_1.joinPoll)({
692
689
  maciAddress: maciAddresses.maciContractAddress,
693
690
  privateKey: users[i].privateKey.serialize(),
694
- stateIndex: BigInt(i + 1),
695
691
  pollId: 0n,
696
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
692
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
697
693
  useWasm: true,
698
694
  pollWasm: constants_1.testPollJoiningWasmPath,
699
- pollWitgen: constants_1.testPollJoiningWitnessPath,
695
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
700
696
  rapidsnark: constants_1.testRapidsnarkPath,
701
697
  sgDataArg: constants_1.DEFAULT_SG_DATA,
702
698
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -716,7 +712,7 @@ describe("e2e tests", function test() {
716
712
  nonce: 1n,
717
713
  pollId: 0n,
718
714
  newVoteWeight: 9n,
719
- salt: (0, crypto_1.genRandomSalt)(),
715
+ salt: (0, crypto_1.generateRandomSalt)(),
720
716
  privateKey: users[i].privateKey.serialize(),
721
717
  signer,
722
718
  });
@@ -727,7 +723,7 @@ describe("e2e tests", function test() {
727
723
  {
728
724
  pollId: 0n,
729
725
  voteOptionIndex: 1n,
730
- salt: (0, crypto_1.genRandomSalt)(),
726
+ salt: (0, crypto_1.generateRandomSalt)(),
731
727
  nonce: 2n,
732
728
  privateKey: users[0].privateKey,
733
729
  stateIndex: 1n,
@@ -739,7 +735,7 @@ describe("e2e tests", function test() {
739
735
  {
740
736
  pollId: 0n,
741
737
  voteOptionIndex: 2n,
742
- salt: (0, crypto_1.genRandomSalt)(),
738
+ salt: (0, crypto_1.generateRandomSalt)(),
743
739
  nonce: 3n,
744
740
  privateKey: users[2].privateKey,
745
741
  stateIndex: 3n,
@@ -751,7 +747,7 @@ describe("e2e tests", function test() {
751
747
  {
752
748
  pollId: 0n,
753
749
  voteOptionIndex: 3n,
754
- salt: (0, crypto_1.genRandomSalt)(),
750
+ salt: (0, crypto_1.generateRandomSalt)(),
755
751
  nonce: 3n,
756
752
  privateKey: users[3].privateKey,
757
753
  stateIndex: 4n,
@@ -812,7 +808,7 @@ describe("e2e tests", function test() {
812
808
  relayers: [await signer.getAddress()],
813
809
  maciAddress: maciAddresses.maciContractAddress,
814
810
  verifierContractAddress,
815
- vkRegistryContractAddress: vkRegistryAddress,
811
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
816
812
  policyContractAddress: pollPolicyContractAddress,
817
813
  initialVoiceCreditProxyContractAddress,
818
814
  });
@@ -827,12 +823,11 @@ describe("e2e tests", function test() {
827
823
  await (0, sdk_1.joinPoll)({
828
824
  maciAddress: maciAddresses.maciContractAddress,
829
825
  privateKey: users[0].privateKey.serialize(),
830
- stateIndex: 1n,
831
826
  pollId: 0n,
832
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
827
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
833
828
  useWasm: true,
834
829
  pollWasm: constants_1.testPollJoiningWasmPath,
835
- pollWitgen: constants_1.testPollJoiningWitnessPath,
830
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
836
831
  rapidsnark: constants_1.testRapidsnarkPath,
837
832
  sgDataArg: constants_1.DEFAULT_SG_DATA,
838
833
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -847,7 +842,7 @@ describe("e2e tests", function test() {
847
842
  pollId: 0n,
848
843
  newVoteWeight: 9n,
849
844
  maciAddress: maciAddresses.maciContractAddress,
850
- salt: (0, crypto_1.genRandomSalt)(),
845
+ salt: (0, crypto_1.generateRandomSalt)(),
851
846
  privateKey: users[0].privateKey.serialize(),
852
847
  signer,
853
848
  });
@@ -867,12 +862,11 @@ describe("e2e tests", function test() {
867
862
  await (0, sdk_1.joinPoll)({
868
863
  maciAddress: maciAddresses.maciContractAddress,
869
864
  privateKey: users[1].privateKey.serialize(),
870
- stateIndex: 2n,
871
865
  pollId: 0n,
872
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
866
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
873
867
  useWasm: true,
874
868
  pollWasm: constants_1.testPollJoiningWasmPath,
875
- pollWitgen: constants_1.testPollJoiningWitnessPath,
869
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
876
870
  rapidsnark: constants_1.testRapidsnarkPath,
877
871
  sgDataArg: constants_1.DEFAULT_SG_DATA,
878
872
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -882,7 +876,7 @@ describe("e2e tests", function test() {
882
876
  {
883
877
  pollId: 0n,
884
878
  voteOptionIndex: 0n,
885
- salt: (0, crypto_1.genRandomSalt)(),
879
+ salt: (0, crypto_1.generateRandomSalt)(),
886
880
  nonce: 1n,
887
881
  privateKey: users[1].privateKey,
888
882
  stateIndex: 2n,
@@ -930,7 +924,7 @@ describe("e2e tests", function test() {
930
924
  relayers: [await signer.getAddress()],
931
925
  maciAddress: maciAddresses.maciContractAddress,
932
926
  verifierContractAddress,
933
- vkRegistryContractAddress: vkRegistryAddress,
927
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
934
928
  policyContractAddress: pollPolicyContractAddress,
935
929
  initialVoiceCreditProxyContractAddress,
936
930
  });
@@ -954,12 +948,11 @@ describe("e2e tests", function test() {
954
948
  await (0, sdk_1.joinPoll)({
955
949
  maciAddress: maciAddresses.maciContractAddress,
956
950
  privateKey: users[3].privateKey.serialize(),
957
- stateIndex: 4n,
958
951
  pollId: 1n,
959
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
952
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
960
953
  useWasm: true,
961
954
  pollWasm: constants_1.testPollJoiningWasmPath,
962
- pollWitgen: constants_1.testPollJoiningWitnessPath,
955
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
963
956
  rapidsnark: constants_1.testRapidsnarkPath,
964
957
  sgDataArg: constants_1.DEFAULT_SG_DATA,
965
958
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -969,12 +962,11 @@ describe("e2e tests", function test() {
969
962
  await (0, sdk_1.joinPoll)({
970
963
  maciAddress: maciAddresses.maciContractAddress,
971
964
  privateKey: users[4].privateKey.serialize(),
972
- stateIndex: 5n,
973
965
  pollId: 1n,
974
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
966
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
975
967
  useWasm: true,
976
968
  pollWasm: constants_1.testPollJoiningWasmPath,
977
- pollWitgen: constants_1.testPollJoiningWitnessPath,
969
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
978
970
  rapidsnark: constants_1.testRapidsnarkPath,
979
971
  sgDataArg: constants_1.DEFAULT_SG_DATA,
980
972
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -986,7 +978,7 @@ describe("e2e tests", function test() {
986
978
  {
987
979
  pollId: 1n,
988
980
  voteOptionIndex: 1n,
989
- salt: (0, crypto_1.genRandomSalt)(),
981
+ salt: (0, crypto_1.generateRandomSalt)(),
990
982
  nonce: 1n,
991
983
  privateKey: users[0].privateKey,
992
984
  stateIndex: 1n,
@@ -998,7 +990,7 @@ describe("e2e tests", function test() {
998
990
  {
999
991
  pollId: 1n,
1000
992
  voteOptionIndex: 0n,
1001
- salt: (0, crypto_1.genRandomSalt)(),
993
+ salt: (0, crypto_1.generateRandomSalt)(),
1002
994
  nonce: 1n,
1003
995
  privateKey: users[1].privateKey,
1004
996
  stateIndex: 1n,
@@ -1028,7 +1020,7 @@ describe("e2e tests", function test() {
1028
1020
  pollId: 1n,
1029
1021
  newVoteWeight: 7n,
1030
1022
  maciAddress: maciAddresses.maciContractAddress,
1031
- salt: (0, crypto_1.genRandomSalt)(),
1023
+ salt: (0, crypto_1.generateRandomSalt)(),
1032
1024
  privateKey: users[0].privateKey.serialize(),
1033
1025
  signer,
1034
1026
  });
@@ -1042,7 +1034,7 @@ describe("e2e tests", function test() {
1042
1034
  pollId: 1n,
1043
1035
  newVoteWeight: 7n,
1044
1036
  maciAddress: maciAddresses.maciContractAddress,
1045
- salt: (0, crypto_1.genRandomSalt)(),
1037
+ salt: (0, crypto_1.generateRandomSalt)(),
1046
1038
  privateKey: users[1].privateKey.serialize(),
1047
1039
  signer,
1048
1040
  });
@@ -1098,7 +1090,7 @@ describe("e2e tests", function test() {
1098
1090
  relayers: [await signer.getAddress()],
1099
1091
  maciAddress: maciAddresses.maciContractAddress,
1100
1092
  verifierContractAddress,
1101
- vkRegistryContractAddress: vkRegistryAddress,
1093
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
1102
1094
  policyContractAddress: pollPolicyContractAddress,
1103
1095
  initialVoiceCreditProxyContractAddress,
1104
1096
  });
@@ -1128,12 +1120,11 @@ describe("e2e tests", function test() {
1128
1120
  await (0, sdk_1.joinPoll)({
1129
1121
  maciAddress: maciAddresses.maciContractAddress,
1130
1122
  privateKey: users[i].privateKey.serialize(),
1131
- stateIndex: BigInt(i + 1),
1132
1123
  pollId: 0n,
1133
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
1124
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
1134
1125
  useWasm: true,
1135
1126
  pollWasm: constants_1.testPollJoiningWasmPath,
1136
- pollWitgen: constants_1.testPollJoiningWitnessPath,
1127
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
1137
1128
  rapidsnark: constants_1.testRapidsnarkPath,
1138
1129
  sgDataArg: constants_1.DEFAULT_SG_DATA,
1139
1130
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -1159,7 +1150,7 @@ describe("e2e tests", function test() {
1159
1150
  pollId: 0n,
1160
1151
  newVoteWeight: 9n,
1161
1152
  maciAddress: maciAddresses.maciContractAddress,
1162
- salt: (0, crypto_1.genRandomSalt)(),
1153
+ salt: (0, crypto_1.generateRandomSalt)(),
1163
1154
  privateKey: users[0].privateKey.serialize(),
1164
1155
  signer,
1165
1156
  });
@@ -1167,7 +1158,7 @@ describe("e2e tests", function test() {
1167
1158
  {
1168
1159
  pollId: 0n,
1169
1160
  voteOptionIndex: 0n,
1170
- salt: (0, crypto_1.genRandomSalt)(),
1161
+ salt: (0, crypto_1.generateRandomSalt)(),
1171
1162
  nonce: 1n,
1172
1163
  privateKey: users[0].privateKey,
1173
1164
  stateIndex: 1n,
@@ -1216,7 +1207,7 @@ describe("e2e tests", function test() {
1216
1207
  relayers: [await signer.getAddress()],
1217
1208
  maciAddress: maciAddresses.maciContractAddress,
1218
1209
  verifierContractAddress,
1219
- vkRegistryContractAddress: vkRegistryAddress,
1210
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
1220
1211
  policyContractAddress: pollPolicyContractAddress,
1221
1212
  initialVoiceCreditProxyContractAddress,
1222
1213
  });
@@ -1233,7 +1224,7 @@ describe("e2e tests", function test() {
1233
1224
  relayers: [await signer.getAddress()],
1234
1225
  maciAddress: maciAddresses.maciContractAddress,
1235
1226
  verifierContractAddress,
1236
- vkRegistryContractAddress: vkRegistryAddress,
1227
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
1237
1228
  policyContractAddress: pollPolicyContractAddress,
1238
1229
  initialVoiceCreditProxyContractAddress,
1239
1230
  });
@@ -1241,18 +1232,18 @@ describe("e2e tests", function test() {
1241
1232
  });
1242
1233
  it("join the second and third polls", async () => {
1243
1234
  // eslint-disable-next-line @typescript-eslint/prefer-for-of
1244
- for (let p = 1; p <= 2; p += 1) {
1235
+ for (let pollId = 1; pollId <= 2; pollId += 1) {
1236
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
1245
1237
  for (let i = 0; i < users.length; i += 1) {
1246
1238
  // eslint-disable-next-line no-await-in-loop
1247
1239
  await (0, sdk_1.joinPoll)({
1248
1240
  maciAddress: maciAddresses.maciContractAddress,
1249
1241
  privateKey: users[i].privateKey.serialize(),
1250
- stateIndex: BigInt(i + 1),
1251
- pollId: BigInt(p),
1252
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
1242
+ pollId: BigInt(pollId),
1243
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
1253
1244
  useWasm: true,
1254
1245
  pollWasm: constants_1.testPollJoiningWasmPath,
1255
- pollWitgen: constants_1.testPollJoiningWitnessPath,
1246
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
1256
1247
  rapidsnark: constants_1.testRapidsnarkPath,
1257
1248
  sgDataArg: constants_1.DEFAULT_SG_DATA,
1258
1249
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -1261,7 +1252,7 @@ describe("e2e tests", function test() {
1261
1252
  // eslint-disable-next-line no-await-in-loop
1262
1253
  const { isJoined, pollStateIndex } = await (0, sdk_1.getJoinedUserData)({
1263
1254
  maciAddress: maciAddresses.maciContractAddress,
1264
- pollId: BigInt(p),
1255
+ pollId: BigInt(pollId),
1265
1256
  pollPublicKey: users[i].publicKey.serialize(),
1266
1257
  signer,
1267
1258
  startBlock: 0,
@@ -1280,7 +1271,7 @@ describe("e2e tests", function test() {
1280
1271
  pollId: 1n,
1281
1272
  newVoteWeight: 9n,
1282
1273
  maciAddress: maciAddresses.maciContractAddress,
1283
- salt: (0, crypto_1.genRandomSalt)(),
1274
+ salt: (0, crypto_1.generateRandomSalt)(),
1284
1275
  privateKey: users[0].privateKey.serialize(),
1285
1276
  signer,
1286
1277
  });
@@ -1292,7 +1283,7 @@ describe("e2e tests", function test() {
1292
1283
  pollId: 1n,
1293
1284
  newVoteWeight: 1n,
1294
1285
  maciAddress: maciAddresses.maciContractAddress,
1295
- salt: (0, crypto_1.genRandomSalt)(),
1286
+ salt: (0, crypto_1.generateRandomSalt)(),
1296
1287
  privateKey: users[1].privateKey.serialize(),
1297
1288
  signer,
1298
1289
  });
@@ -1304,7 +1295,7 @@ describe("e2e tests", function test() {
1304
1295
  pollId: 1n,
1305
1296
  newVoteWeight: 3n,
1306
1297
  maciAddress: maciAddresses.maciContractAddress,
1307
- salt: (0, crypto_1.genRandomSalt)(),
1298
+ salt: (0, crypto_1.generateRandomSalt)(),
1308
1299
  privateKey: users[2].privateKey.serialize(),
1309
1300
  signer,
1310
1301
  });
@@ -1314,7 +1305,7 @@ describe("e2e tests", function test() {
1314
1305
  {
1315
1306
  pollId: 1n,
1316
1307
  voteOptionIndex: 0n,
1317
- salt: (0, crypto_1.genRandomSalt)(),
1308
+ salt: (0, crypto_1.generateRandomSalt)(),
1318
1309
  nonce: 1n,
1319
1310
  privateKey: users[0].privateKey,
1320
1311
  stateIndex: 1n,
@@ -1340,7 +1331,7 @@ describe("e2e tests", function test() {
1340
1331
  {
1341
1332
  pollId: 2n,
1342
1333
  voteOptionIndex: 7n,
1343
- salt: (0, crypto_1.genRandomSalt)(),
1334
+ salt: (0, crypto_1.generateRandomSalt)(),
1344
1335
  nonce: 1n,
1345
1336
  privateKey: users[4].privateKey,
1346
1337
  stateIndex: 4n,
@@ -1352,7 +1343,7 @@ describe("e2e tests", function test() {
1352
1343
  {
1353
1344
  pollId: 2n,
1354
1345
  voteOptionIndex: 5n,
1355
- salt: (0, crypto_1.genRandomSalt)(),
1346
+ salt: (0, crypto_1.generateRandomSalt)(),
1356
1347
  nonce: 1n,
1357
1348
  privateKey: users[5].privateKey,
1358
1349
  stateIndex: 5n,
@@ -1382,7 +1373,7 @@ describe("e2e tests", function test() {
1382
1373
  pollId: 2n,
1383
1374
  newVoteWeight: 3n,
1384
1375
  maciAddress: maciAddresses.maciContractAddress,
1385
- salt: (0, crypto_1.genRandomSalt)(),
1376
+ salt: (0, crypto_1.generateRandomSalt)(),
1386
1377
  privateKey: users[3].privateKey.serialize(),
1387
1378
  signer,
1388
1379
  });
@@ -1394,7 +1385,7 @@ describe("e2e tests", function test() {
1394
1385
  pollId: 2n,
1395
1386
  newVoteWeight: 2n,
1396
1387
  maciAddress: maciAddresses.maciContractAddress,
1397
- salt: (0, crypto_1.genRandomSalt)(),
1388
+ salt: (0, crypto_1.generateRandomSalt)(),
1398
1389
  privateKey: users[4].privateKey.serialize(),
1399
1390
  signer,
1400
1391
  });
@@ -1406,7 +1397,7 @@ describe("e2e tests", function test() {
1406
1397
  pollId: 2n,
1407
1398
  newVoteWeight: 9n,
1408
1399
  maciAddress: maciAddresses.maciContractAddress,
1409
- salt: (0, crypto_1.genRandomSalt)(),
1400
+ salt: (0, crypto_1.generateRandomSalt)(),
1410
1401
  privateKey: users[5].privateKey.serialize(),
1411
1402
  signer,
1412
1403
  });
@@ -1490,7 +1481,7 @@ describe("e2e tests", function test() {
1490
1481
  relayers: [await signer.getAddress()],
1491
1482
  maciAddress: maciAddresses.maciContractAddress,
1492
1483
  verifierContractAddress,
1493
- vkRegistryContractAddress: vkRegistryAddress,
1484
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
1494
1485
  policyContractAddress: pollPolicyContractAddress,
1495
1486
  initialVoiceCreditProxyContractAddress,
1496
1487
  });
@@ -1508,12 +1499,11 @@ describe("e2e tests", function test() {
1508
1499
  await (0, sdk_1.joinPoll)({
1509
1500
  maciAddress: maciAddresses.maciContractAddress,
1510
1501
  privateKey: user.privateKey.serialize(),
1511
- stateIndex: 1n,
1512
1502
  pollId: 0n,
1513
- pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
1503
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
1514
1504
  useWasm: true,
1515
1505
  pollWasm: constants_1.testPollJoiningWasmPath,
1516
- pollWitgen: constants_1.testPollJoiningWitnessPath,
1506
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
1517
1507
  rapidsnark: constants_1.testRapidsnarkPath,
1518
1508
  sgDataArg: constants_1.DEFAULT_SG_DATA,
1519
1509
  ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
@@ -1529,7 +1519,7 @@ describe("e2e tests", function test() {
1529
1519
  pollId: 0n,
1530
1520
  newVoteWeight: 3n,
1531
1521
  maciAddress: maciAddresses.maciContractAddress,
1532
- salt: (0, crypto_1.genRandomSalt)(),
1522
+ salt: (0, crypto_1.generateRandomSalt)(),
1533
1523
  privateKey: user.privateKey.serialize(),
1534
1524
  signer,
1535
1525
  });
@@ -1539,7 +1529,7 @@ describe("e2e tests", function test() {
1539
1529
  {
1540
1530
  pollId: 0n,
1541
1531
  voteOptionIndex: 5n,
1542
- salt: (0, crypto_1.genRandomSalt)(),
1532
+ salt: (0, crypto_1.generateRandomSalt)(),
1543
1533
  nonce: 1n,
1544
1534
  privateKey: user.privateKey,
1545
1535
  stateIndex: 1n,