@maci-protocol/testing 0.0.0-ci.f9da2fc → 0.0.0-ci.fc91dc9

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 (40) hide show
  1. package/LICENSE +1 -2
  2. package/build/ts/__tests__/e2e.nonQv.test.js +21 -21
  3. package/build/ts/__tests__/e2e.nonQv.test.js.map +1 -1
  4. package/build/ts/__tests__/e2e.test.js +216 -216
  5. package/build/ts/__tests__/e2e.test.js.map +1 -1
  6. package/build/ts/__tests__/integration.test.js +36 -33
  7. package/build/ts/__tests__/integration.test.js.map +1 -1
  8. package/build/ts/__tests__/keyChange.test.js +54 -54
  9. package/build/ts/__tests__/keyChange.test.js.map +1 -1
  10. package/build/ts/__tests__/maciKeys.test.js +34 -34
  11. package/build/ts/__tests__/maciKeys.test.js.map +1 -1
  12. package/build/ts/__tests__/unit/joinPoll.test.js +10 -10
  13. package/build/ts/__tests__/unit/joinPoll.test.js.map +1 -1
  14. package/build/ts/__tests__/unit/poll.test.js +5 -5
  15. package/build/ts/__tests__/unit/poll.test.js.map +1 -1
  16. package/build/ts/__tests__/unit/publish.test.js +8 -8
  17. package/build/ts/__tests__/unit/publish.test.js.map +1 -1
  18. package/build/ts/__tests__/unit/signup.test.js +8 -8
  19. package/build/ts/__tests__/unit/signup.test.js.map +1 -1
  20. package/build/ts/__tests__/unit/utils.test.js +12 -12
  21. package/build/ts/__tests__/unit/utils.test.js.map +1 -1
  22. package/build/ts/constants.d.ts +6 -5
  23. package/build/ts/constants.d.ts.map +1 -1
  24. package/build/ts/constants.js +14 -11
  25. package/build/ts/constants.js.map +1 -1
  26. package/build/ts/testingClass.d.ts.map +1 -1
  27. package/build/ts/testingClass.js +14 -12
  28. package/build/ts/testingClass.js.map +1 -1
  29. package/build/ts/types.d.ts +4 -4
  30. package/build/ts/types.d.ts.map +1 -1
  31. package/build/ts/user.d.ts +2 -2
  32. package/build/ts/user.d.ts.map +1 -1
  33. package/build/ts/user.js +1 -1
  34. package/build/ts/user.js.map +1 -1
  35. package/build/ts/utils.d.ts +2 -2
  36. package/build/ts/utils.d.ts.map +1 -1
  37. package/build/ts/utils.js +4 -4
  38. package/build/ts/utils.js.map +1 -1
  39. package/build/tsconfig.tsbuildinfo +1 -1
  40. package/package.json +10 -10
@@ -27,7 +27,7 @@ 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;
@@ -42,23 +42,23 @@ describe("e2e tests", function test() {
42
42
  processDatFile: constants_1.testProcessMessagesWitnessDatPath,
43
43
  tallyWitgen: constants_1.testTallyVotesWitnessPath,
44
44
  tallyDatFile: constants_1.testTallyVotesWitnessDatPath,
45
- coordinatorPrivateKey: constants_1.coordinatorPrivKey,
45
+ coordinatorPrivateKey: constants_1.coordinatorPrivateKey,
46
46
  processWasm: constants_1.testProcessMessagesWasmPath,
47
47
  tallyWasm: constants_1.testTallyVotesWasmPath,
48
48
  useWasm,
49
49
  useQuadraticVoting: true,
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 });
54
+ // we deploy the verifying keys registry contract
55
+ verifyingKeysRegistryAddress = await (0, sdk_1.deployVerifyingKeysRegistryContract)({ signer });
56
56
  const [initialVoiceCreditProxy] = await (0, sdk_1.deployConstantInitialVoiceCreditProxy)({ amount: constants_1.DEFAULT_INITIAL_VOICE_CREDITS }, signer, undefined, true);
57
57
  initialVoiceCreditProxyContractAddress = await initialVoiceCreditProxy.getAddress();
58
58
  const verifier = await (0, sdk_1.deployVerifier)(signer, true);
59
59
  verifierContractAddress = await verifier.getAddress();
60
60
  // we set the verifying keys
61
- await (0, sdk_1.setVerifyingKeys)({ ...(await (0, constants_1.verifyingKeysArgs)(signer)), vkRegistryAddress });
61
+ await (0, sdk_1.setVerifyingKeys)({ ...(await (0, constants_1.verifyingKeysArgs)(signer)), verifyingKeysRegistryAddress });
62
62
  });
63
63
  describe("2 signups (1 after stateAq is merged and logs are fetched), 1 message", () => {
64
64
  after(async () => {
@@ -86,7 +86,7 @@ describe("e2e tests", function test() {
86
86
  relayers: [await signer.getAddress()],
87
87
  maciAddress: maciAddresses.maciContractAddress,
88
88
  verifierContractAddress,
89
- vkRegistryContractAddress: vkRegistryAddress,
89
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
90
90
  policyContractAddress: pollPolicyContractAddress,
91
91
  initialVoiceCreditProxyContractAddress,
92
92
  });
@@ -94,7 +94,7 @@ describe("e2e tests", function test() {
94
94
  it("should signup one user", async () => {
95
95
  await (0, sdk_1.signup)({
96
96
  maciAddress: maciAddresses.maciContractAddress,
97
- maciPubKey: user.pubKey.serialize(),
97
+ maciPublicKey: user.publicKey.serialize(),
98
98
  sgData: constants_1.DEFAULT_SG_DATA,
99
99
  signer,
100
100
  });
@@ -102,7 +102,7 @@ describe("e2e tests", function test() {
102
102
  it("should join one user", async () => {
103
103
  await (0, sdk_1.joinPoll)({
104
104
  maciAddress: maciAddresses.maciContractAddress,
105
- privateKey: user.privKey.serialize(),
105
+ privateKey: user.privateKey.serialize(),
106
106
  stateIndex: 1n,
107
107
  pollId: 0n,
108
108
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
@@ -117,15 +117,15 @@ describe("e2e tests", function test() {
117
117
  });
118
118
  it("should publish one message", async () => {
119
119
  await (0, sdk_1.publish)({
120
- pubkey: user.pubKey.serialize(),
120
+ publicKey: user.publicKey.serialize(),
121
121
  stateIndex: 1n,
122
122
  voteOptionIndex: 0n,
123
123
  nonce: 1n,
124
124
  pollId: 0n,
125
125
  newVoteWeight: 9n,
126
126
  maciAddress: maciAddresses.maciContractAddress,
127
- salt: (0, crypto_1.genRandomSalt)(),
128
- privateKey: user.privKey.serialize(),
127
+ salt: (0, crypto_1.generateRandomSalt)(),
128
+ privateKey: user.privateKey.serialize(),
129
129
  signer,
130
130
  });
131
131
  });
@@ -139,7 +139,7 @@ describe("e2e tests", function test() {
139
139
  });
140
140
  await (0, sdk_1.signup)({
141
141
  maciAddress: maciAddresses.maciContractAddress,
142
- maciPubKey: new domainobjs_1.Keypair().pubKey.serialize(),
142
+ maciPublicKey: new domainobjs_1.Keypair().publicKey.serialize(),
143
143
  sgData: constants_1.DEFAULT_SG_DATA,
144
144
  signer,
145
145
  });
@@ -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
  });
@@ -188,7 +188,7 @@ describe("e2e tests", function test() {
188
188
  // eslint-disable-next-line no-await-in-loop
189
189
  await (0, sdk_1.signup)({
190
190
  maciAddress: maciAddresses.maciContractAddress,
191
- maciPubKey: users[i].pubKey.serialize(),
191
+ maciPublicKey: users[i].publicKey.serialize(),
192
192
  sgData: constants_1.DEFAULT_SG_DATA,
193
193
  signer,
194
194
  });
@@ -200,7 +200,7 @@ describe("e2e tests", function test() {
200
200
  // eslint-disable-next-line no-await-in-loop
201
201
  await (0, sdk_1.joinPoll)({
202
202
  maciAddress: maciAddresses.maciContractAddress,
203
- privateKey: users[i].privKey.serialize(),
203
+ privateKey: users[i].privateKey.serialize(),
204
204
  stateIndex: BigInt(i + 1),
205
205
  pollId: 0n,
206
206
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
@@ -216,99 +216,99 @@ describe("e2e tests", function test() {
216
216
  });
217
217
  it("should publish eight messages", async () => {
218
218
  await (0, sdk_1.publish)({
219
- pubkey: users[0].pubKey.serialize(),
219
+ publicKey: users[0].publicKey.serialize(),
220
220
  stateIndex: 1n,
221
221
  voteOptionIndex: 0n,
222
222
  nonce: 2n,
223
223
  pollId: 0n,
224
224
  newVoteWeight: 4n,
225
225
  maciAddress: maciAddresses.maciContractAddress,
226
- salt: (0, crypto_1.genRandomSalt)(),
227
- privateKey: users[0].privKey.serialize(),
226
+ salt: (0, crypto_1.generateRandomSalt)(),
227
+ privateKey: users[0].privateKey.serialize(),
228
228
  signer,
229
229
  });
230
230
  await (0, sdk_1.publish)({
231
- pubkey: users[0].pubKey.serialize(),
231
+ publicKey: users[0].publicKey.serialize(),
232
232
  stateIndex: 1n,
233
233
  voteOptionIndex: 0n,
234
234
  nonce: 2n,
235
235
  pollId: 0n,
236
236
  newVoteWeight: 3n,
237
237
  maciAddress: maciAddresses.maciContractAddress,
238
- salt: (0, crypto_1.genRandomSalt)(),
239
- privateKey: users[0].privKey.serialize(),
238
+ salt: (0, crypto_1.generateRandomSalt)(),
239
+ privateKey: users[0].privateKey.serialize(),
240
240
  signer,
241
241
  });
242
242
  await (0, sdk_1.publish)({
243
- pubkey: users[0].pubKey.serialize(),
243
+ publicKey: users[0].publicKey.serialize(),
244
244
  stateIndex: 1n,
245
245
  voteOptionIndex: 0n,
246
246
  nonce: 1n,
247
247
  pollId: 0n,
248
248
  newVoteWeight: 9n,
249
249
  maciAddress: maciAddresses.maciContractAddress,
250
- salt: (0, crypto_1.genRandomSalt)(),
251
- privateKey: users[0].privKey.serialize(),
250
+ salt: (0, crypto_1.generateRandomSalt)(),
251
+ privateKey: users[0].privateKey.serialize(),
252
252
  signer,
253
253
  });
254
254
  await (0, sdk_1.publish)({
255
- pubkey: users[1].pubKey.serialize(),
255
+ publicKey: users[1].publicKey.serialize(),
256
256
  stateIndex: 2n,
257
257
  voteOptionIndex: 2n,
258
258
  nonce: 1n,
259
259
  pollId: 0n,
260
260
  newVoteWeight: 9n,
261
261
  maciAddress: maciAddresses.maciContractAddress,
262
- salt: (0, crypto_1.genRandomSalt)(),
263
- privateKey: users[1].privKey.serialize(),
262
+ salt: (0, crypto_1.generateRandomSalt)(),
263
+ privateKey: users[1].privateKey.serialize(),
264
264
  signer,
265
265
  });
266
266
  await (0, sdk_1.publish)({
267
- pubkey: users[2].pubKey.serialize(),
267
+ publicKey: users[2].publicKey.serialize(),
268
268
  stateIndex: 3n,
269
269
  voteOptionIndex: 2n,
270
270
  nonce: 1n,
271
271
  pollId: 0n,
272
272
  newVoteWeight: 9n,
273
273
  maciAddress: maciAddresses.maciContractAddress,
274
- salt: (0, crypto_1.genRandomSalt)(),
275
- privateKey: users[2].privKey.serialize(),
274
+ salt: (0, crypto_1.generateRandomSalt)(),
275
+ privateKey: users[2].privateKey.serialize(),
276
276
  signer,
277
277
  });
278
278
  await (0, sdk_1.publish)({
279
- pubkey: users[3].pubKey.serialize(),
279
+ publicKey: users[3].publicKey.serialize(),
280
280
  stateIndex: 4n,
281
281
  voteOptionIndex: 2n,
282
282
  nonce: 3n,
283
283
  pollId: 0n,
284
284
  newVoteWeight: 3n,
285
285
  maciAddress: maciAddresses.maciContractAddress,
286
- salt: (0, crypto_1.genRandomSalt)(),
287
- privateKey: users[3].privKey.serialize(),
286
+ salt: (0, crypto_1.generateRandomSalt)(),
287
+ privateKey: users[3].privateKey.serialize(),
288
288
  signer,
289
289
  });
290
290
  await (0, sdk_1.publish)({
291
- pubkey: users[3].pubKey.serialize(),
291
+ publicKey: users[3].publicKey.serialize(),
292
292
  stateIndex: 4n,
293
293
  voteOptionIndex: 2n,
294
294
  nonce: 2n,
295
295
  pollId: 0n,
296
296
  newVoteWeight: 2n,
297
297
  maciAddress: maciAddresses.maciContractAddress,
298
- salt: (0, crypto_1.genRandomSalt)(),
299
- privateKey: users[3].privKey.serialize(),
298
+ salt: (0, crypto_1.generateRandomSalt)(),
299
+ privateKey: users[3].privateKey.serialize(),
300
300
  signer,
301
301
  });
302
302
  await (0, sdk_1.publish)({
303
- pubkey: users[3].pubKey.serialize(),
303
+ publicKey: users[3].publicKey.serialize(),
304
304
  stateIndex: 4n,
305
305
  voteOptionIndex: 1n,
306
306
  nonce: 1n,
307
307
  pollId: 0n,
308
308
  newVoteWeight: 9n,
309
309
  maciAddress: maciAddresses.maciContractAddress,
310
- salt: (0, crypto_1.genRandomSalt)(),
311
- privateKey: users[3].privKey.serialize(),
310
+ salt: (0, crypto_1.generateRandomSalt)(),
311
+ privateKey: users[3].privateKey.serialize(),
312
312
  signer,
313
313
  });
314
314
  });
@@ -317,98 +317,98 @@ describe("e2e tests", function test() {
317
317
  {
318
318
  pollId: 0n,
319
319
  voteOptionIndex: 1n,
320
- salt: (0, crypto_1.genRandomSalt)(),
320
+ salt: (0, crypto_1.generateRandomSalt)(),
321
321
  nonce: 2n,
322
- privateKey: users[0].privKey,
322
+ privateKey: users[0].privateKey,
323
323
  stateIndex: 1n,
324
324
  voteWeight: 4n,
325
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
325
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
326
326
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
327
- newPubKey: users[0].pubKey,
327
+ newPublicKey: users[0].publicKey,
328
328
  },
329
329
  {
330
330
  pollId: 0n,
331
331
  voteOptionIndex: 1n,
332
- salt: (0, crypto_1.genRandomSalt)(),
332
+ salt: (0, crypto_1.generateRandomSalt)(),
333
333
  nonce: 2n,
334
- privateKey: users[0].privKey,
334
+ privateKey: users[0].privateKey,
335
335
  stateIndex: 1n,
336
336
  voteWeight: 3n,
337
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
337
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
338
338
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
339
- newPubKey: users[0].pubKey,
339
+ newPublicKey: users[0].publicKey,
340
340
  },
341
341
  {
342
342
  pollId: 0n,
343
343
  voteOptionIndex: 1n,
344
- salt: (0, crypto_1.genRandomSalt)(),
344
+ salt: (0, crypto_1.generateRandomSalt)(),
345
345
  nonce: 1n,
346
- privateKey: users[0].privKey,
346
+ privateKey: users[0].privateKey,
347
347
  stateIndex: 1n,
348
348
  voteWeight: 9n,
349
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
349
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
350
350
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
351
- newPubKey: users[0].pubKey,
351
+ newPublicKey: users[0].publicKey,
352
352
  },
353
353
  {
354
354
  pollId: 0n,
355
355
  voteOptionIndex: 1n,
356
- salt: (0, crypto_1.genRandomSalt)(),
356
+ salt: (0, crypto_1.generateRandomSalt)(),
357
357
  nonce: 1n,
358
- privateKey: users[1].privKey,
358
+ privateKey: users[1].privateKey,
359
359
  stateIndex: 2n,
360
360
  voteWeight: 9n,
361
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
361
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
362
362
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
363
- newPubKey: users[1].pubKey,
363
+ newPublicKey: users[1].publicKey,
364
364
  },
365
365
  {
366
366
  pollId: 0n,
367
367
  voteOptionIndex: 1n,
368
- salt: (0, crypto_1.genRandomSalt)(),
368
+ salt: (0, crypto_1.generateRandomSalt)(),
369
369
  nonce: 1n,
370
- privateKey: users[2].privKey,
370
+ privateKey: users[2].privateKey,
371
371
  stateIndex: 3n,
372
372
  voteWeight: 9n,
373
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
373
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
374
374
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
375
- newPubKey: users[2].pubKey,
375
+ newPublicKey: users[2].publicKey,
376
376
  },
377
377
  {
378
378
  pollId: 0n,
379
379
  voteOptionIndex: 0n,
380
- salt: (0, crypto_1.genRandomSalt)(),
380
+ salt: (0, crypto_1.generateRandomSalt)(),
381
381
  nonce: 3n,
382
- privateKey: users[3].privKey,
382
+ privateKey: users[3].privateKey,
383
383
  stateIndex: 4n,
384
384
  voteWeight: 3n,
385
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
385
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
386
386
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
387
- newPubKey: users[3].pubKey,
387
+ newPublicKey: users[3].publicKey,
388
388
  },
389
389
  {
390
390
  pollId: 0n,
391
391
  voteOptionIndex: 0n,
392
- salt: (0, crypto_1.genRandomSalt)(),
392
+ salt: (0, crypto_1.generateRandomSalt)(),
393
393
  nonce: 2n,
394
- privateKey: users[3].privKey,
394
+ privateKey: users[3].privateKey,
395
395
  stateIndex: 4n,
396
396
  voteWeight: 2n,
397
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
397
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
398
398
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
399
- newPubKey: users[3].pubKey,
399
+ newPublicKey: users[3].publicKey,
400
400
  },
401
401
  {
402
402
  pollId: 0n,
403
403
  voteOptionIndex: 0n,
404
- salt: (0, crypto_1.genRandomSalt)(),
404
+ salt: (0, crypto_1.generateRandomSalt)(),
405
405
  nonce: 1n,
406
- privateKey: users[3].privKey,
406
+ privateKey: users[3].privateKey,
407
407
  stateIndex: 4n,
408
408
  voteWeight: 9n,
409
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
409
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
410
410
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
411
- newPubKey: users[3].pubKey,
411
+ newPublicKey: users[3].publicKey,
412
412
  },
413
413
  ];
414
414
  const messages = votes
@@ -417,8 +417,8 @@ describe("e2e tests", function test() {
417
417
  maciAddress: maciAddresses.maciContractAddress,
418
418
  poll: 0,
419
419
  data: message.data.map(String),
420
- publicKey: ephemeralKeypair.pubKey.asArray().map(String),
421
- hash: message.hash(ephemeralKeypair.pubKey).toString(),
420
+ publicKey: ephemeralKeypair.publicKey.asArray().map(String),
421
+ hash: message.hash(ephemeralKeypair.publicKey).toString(),
422
422
  }));
423
423
  await (0, utils_1.relayTestMessages)({ messages, signer, pollId: 0, maciAddress: maciAddresses.maciContractAddress });
424
424
  });
@@ -462,7 +462,7 @@ describe("e2e tests", function test() {
462
462
  relayers: [await signer.getAddress()],
463
463
  maciAddress: maciAddresses.maciContractAddress,
464
464
  verifierContractAddress,
465
- vkRegistryContractAddress: vkRegistryAddress,
465
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
466
466
  policyContractAddress: pollPolicyContractAddress,
467
467
  initialVoiceCreditProxyContractAddress,
468
468
  });
@@ -472,7 +472,7 @@ describe("e2e tests", function test() {
472
472
  // eslint-disable-next-line no-await-in-loop
473
473
  await (0, sdk_1.signup)({
474
474
  maciAddress: maciAddresses.maciContractAddress,
475
- maciPubKey: users[i].pubKey.serialize(),
475
+ maciPublicKey: users[i].publicKey.serialize(),
476
476
  sgData: constants_1.DEFAULT_SG_DATA,
477
477
  signer,
478
478
  });
@@ -482,7 +482,7 @@ describe("e2e tests", function test() {
482
482
  // eslint-disable-next-line no-await-in-loop
483
483
  await (0, sdk_1.joinPoll)({
484
484
  maciAddress: maciAddresses.maciContractAddress,
485
- privateKey: users[0].privKey.serialize(),
485
+ privateKey: users[0].privateKey.serialize(),
486
486
  stateIndex: 1n,
487
487
  pollId: 0n,
488
488
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
@@ -501,35 +501,35 @@ describe("e2e tests", function test() {
501
501
  .map(() => (0, sdk_1.generateVote)({
502
502
  pollId: 0n,
503
503
  voteOptionIndex: 0n,
504
- salt: (0, crypto_1.genRandomSalt)(),
504
+ salt: (0, crypto_1.generateRandomSalt)(),
505
505
  nonce: 1n,
506
- privateKey: users[0].privKey,
506
+ privateKey: users[0].privateKey,
507
507
  stateIndex: 1n,
508
508
  voteWeight: 9n,
509
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
509
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
510
510
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
511
- newPubKey: users[0].pubKey,
511
+ newPublicKey: users[0].publicKey,
512
512
  }))
513
513
  .map(({ message, ephemeralKeypair }) => ({
514
514
  maciAddress: maciAddresses.maciContractAddress,
515
515
  poll: 0,
516
516
  data: message.data.map(String),
517
- publicKey: ephemeralKeypair.pubKey.asArray().map(String),
518
- hash: message.hash(ephemeralKeypair.pubKey).toString(),
517
+ publicKey: ephemeralKeypair.publicKey.asArray().map(String),
518
+ hash: message.hash(ephemeralKeypair.publicKey).toString(),
519
519
  }));
520
520
  await (0, utils_1.relayTestMessages)({ messages, signer, pollId: 0, maciAddress: maciAddresses.maciContractAddress });
521
521
  for (let i = 0; i < 12; i += 1) {
522
522
  // eslint-disable-next-line no-await-in-loop
523
523
  await (0, sdk_1.publish)({
524
- pubkey: users[0].pubKey.serialize(),
524
+ publicKey: users[0].publicKey.serialize(),
525
525
  stateIndex: 1n,
526
526
  voteOptionIndex: 0n,
527
527
  nonce: 1n,
528
528
  pollId: 0n,
529
529
  newVoteWeight: 9n,
530
530
  maciAddress: maciAddresses.maciContractAddress,
531
- salt: (0, crypto_1.genRandomSalt)(),
532
- privateKey: users[0].privKey.serialize(),
531
+ salt: (0, crypto_1.generateRandomSalt)(),
532
+ privateKey: users[0].privateKey.serialize(),
533
533
  signer,
534
534
  });
535
535
  }
@@ -574,7 +574,7 @@ describe("e2e tests", function test() {
574
574
  relayers: [await signer.getAddress()],
575
575
  maciAddress: maciAddresses.maciContractAddress,
576
576
  verifierContractAddress,
577
- vkRegistryContractAddress: vkRegistryAddress,
577
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
578
578
  policyContractAddress: pollPolicyContractAddress,
579
579
  initialVoiceCreditProxyContractAddress,
580
580
  });
@@ -585,7 +585,7 @@ describe("e2e tests", function test() {
585
585
  // eslint-disable-next-line no-await-in-loop
586
586
  await (0, sdk_1.signup)({
587
587
  maciAddress: maciAddresses.maciContractAddress,
588
- maciPubKey: users[i].pubKey.serialize(),
588
+ maciPublicKey: users[i].publicKey.serialize(),
589
589
  sgData: constants_1.DEFAULT_SG_DATA,
590
590
  signer,
591
591
  });
@@ -597,7 +597,7 @@ describe("e2e tests", function test() {
597
597
  // eslint-disable-next-line no-await-in-loop
598
598
  await (0, sdk_1.joinPoll)({
599
599
  maciAddress: maciAddresses.maciContractAddress,
600
- privateKey: users[i].privKey.serialize(),
600
+ privateKey: users[i].privateKey.serialize(),
601
601
  stateIndex: BigInt(i + 1),
602
602
  pollId: 0n,
603
603
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
@@ -617,14 +617,14 @@ describe("e2e tests", function test() {
617
617
  // eslint-disable-next-line no-await-in-loop
618
618
  await (0, sdk_1.publish)({
619
619
  maciAddress: maciAddresses.maciContractAddress,
620
- pubkey: users[i].pubKey.serialize(),
620
+ publicKey: users[i].publicKey.serialize(),
621
621
  stateIndex: BigInt(i + 1),
622
622
  voteOptionIndex: 0n,
623
623
  nonce: 1n,
624
624
  pollId: 0n,
625
625
  newVoteWeight: 9n,
626
- salt: (0, crypto_1.genRandomSalt)(),
627
- privateKey: users[i].privKey.serialize(),
626
+ salt: (0, crypto_1.generateRandomSalt)(),
627
+ privateKey: users[i].privateKey.serialize(),
628
628
  signer,
629
629
  });
630
630
  }
@@ -667,7 +667,7 @@ describe("e2e tests", function test() {
667
667
  relayers: [await signer.getAddress()],
668
668
  maciAddress: maciAddresses.maciContractAddress,
669
669
  verifierContractAddress,
670
- vkRegistryContractAddress: vkRegistryAddress,
670
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
671
671
  policyContractAddress: pollPolicyContractAddress,
672
672
  initialVoiceCreditProxyContractAddress,
673
673
  });
@@ -678,7 +678,7 @@ describe("e2e tests", function test() {
678
678
  // eslint-disable-next-line no-await-in-loop
679
679
  await (0, sdk_1.signup)({
680
680
  maciAddress: maciAddresses.maciContractAddress,
681
- maciPubKey: users[i].pubKey.serialize(),
681
+ maciPublicKey: users[i].publicKey.serialize(),
682
682
  sgData: constants_1.DEFAULT_SG_DATA,
683
683
  signer,
684
684
  });
@@ -690,7 +690,7 @@ describe("e2e tests", function test() {
690
690
  // eslint-disable-next-line no-await-in-loop
691
691
  await (0, sdk_1.joinPoll)({
692
692
  maciAddress: maciAddresses.maciContractAddress,
693
- privateKey: users[i].privKey.serialize(),
693
+ privateKey: users[i].privateKey.serialize(),
694
694
  stateIndex: BigInt(i + 1),
695
695
  pollId: 0n,
696
696
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
@@ -710,14 +710,14 @@ describe("e2e tests", function test() {
710
710
  // eslint-disable-next-line no-await-in-loop
711
711
  await (0, sdk_1.publish)({
712
712
  maciAddress: maciAddresses.maciContractAddress,
713
- pubkey: users[i].pubKey.serialize(),
713
+ publicKey: users[i].publicKey.serialize(),
714
714
  stateIndex: 1n,
715
715
  voteOptionIndex: 0n,
716
716
  nonce: 1n,
717
717
  pollId: 0n,
718
718
  newVoteWeight: 9n,
719
- salt: (0, crypto_1.genRandomSalt)(),
720
- privateKey: users[i].privKey.serialize(),
719
+ salt: (0, crypto_1.generateRandomSalt)(),
720
+ privateKey: users[i].privateKey.serialize(),
721
721
  signer,
722
722
  });
723
723
  }
@@ -727,38 +727,38 @@ describe("e2e tests", function test() {
727
727
  {
728
728
  pollId: 0n,
729
729
  voteOptionIndex: 1n,
730
- salt: (0, crypto_1.genRandomSalt)(),
730
+ salt: (0, crypto_1.generateRandomSalt)(),
731
731
  nonce: 2n,
732
- privateKey: users[0].privKey,
732
+ privateKey: users[0].privateKey,
733
733
  stateIndex: 1n,
734
734
  voteWeight: 5n,
735
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
735
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
736
736
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
737
- newPubKey: users[0].pubKey,
737
+ newPublicKey: users[0].publicKey,
738
738
  },
739
739
  {
740
740
  pollId: 0n,
741
741
  voteOptionIndex: 2n,
742
- salt: (0, crypto_1.genRandomSalt)(),
742
+ salt: (0, crypto_1.generateRandomSalt)(),
743
743
  nonce: 3n,
744
- privateKey: users[2].privKey,
744
+ privateKey: users[2].privateKey,
745
745
  stateIndex: 3n,
746
746
  voteWeight: 9n,
747
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
747
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
748
748
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
749
- newPubKey: users[2].pubKey,
749
+ newPublicKey: users[2].publicKey,
750
750
  },
751
751
  {
752
752
  pollId: 0n,
753
753
  voteOptionIndex: 3n,
754
- salt: (0, crypto_1.genRandomSalt)(),
754
+ salt: (0, crypto_1.generateRandomSalt)(),
755
755
  nonce: 3n,
756
- privateKey: users[3].privKey,
756
+ privateKey: users[3].privateKey,
757
757
  stateIndex: 4n,
758
758
  voteWeight: 7n,
759
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
759
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
760
760
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
761
- newPubKey: users[3].pubKey,
761
+ newPublicKey: users[3].publicKey,
762
762
  },
763
763
  ];
764
764
  const messages = votes
@@ -767,8 +767,8 @@ describe("e2e tests", function test() {
767
767
  maciAddress: maciAddresses.maciContractAddress,
768
768
  poll: 0,
769
769
  data: message.data.map(String),
770
- publicKey: ephemeralKeypair.pubKey.asArray().map(String),
771
- hash: message.hash(ephemeralKeypair.pubKey).toString(),
770
+ publicKey: ephemeralKeypair.publicKey.asArray().map(String),
771
+ hash: message.hash(ephemeralKeypair.publicKey).toString(),
772
772
  }));
773
773
  await (0, utils_1.relayTestMessages)({ messages, signer, pollId: 0, maciAddress: maciAddresses.maciContractAddress });
774
774
  });
@@ -812,21 +812,21 @@ describe("e2e tests", function test() {
812
812
  relayers: [await signer.getAddress()],
813
813
  maciAddress: maciAddresses.maciContractAddress,
814
814
  verifierContractAddress,
815
- vkRegistryContractAddress: vkRegistryAddress,
815
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
816
816
  policyContractAddress: pollPolicyContractAddress,
817
817
  initialVoiceCreditProxyContractAddress,
818
818
  });
819
819
  // signup
820
820
  await (0, sdk_1.signup)({
821
821
  maciAddress: maciAddresses.maciContractAddress,
822
- maciPubKey: users[0].pubKey.serialize(),
822
+ maciPublicKey: users[0].publicKey.serialize(),
823
823
  sgData: constants_1.DEFAULT_SG_DATA,
824
824
  signer,
825
825
  });
826
826
  // joinPoll
827
827
  await (0, sdk_1.joinPoll)({
828
828
  maciAddress: maciAddresses.maciContractAddress,
829
- privateKey: users[0].privKey.serialize(),
829
+ privateKey: users[0].privateKey.serialize(),
830
830
  stateIndex: 1n,
831
831
  pollId: 0n,
832
832
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
@@ -840,33 +840,33 @@ describe("e2e tests", function test() {
840
840
  });
841
841
  // publish
842
842
  await (0, sdk_1.publish)({
843
- pubkey: users[0].pubKey.serialize(),
843
+ publicKey: users[0].publicKey.serialize(),
844
844
  stateIndex: 1n,
845
845
  voteOptionIndex: 0n,
846
846
  nonce: 1n,
847
847
  pollId: 0n,
848
848
  newVoteWeight: 9n,
849
849
  maciAddress: maciAddresses.maciContractAddress,
850
- salt: (0, crypto_1.genRandomSalt)(),
851
- privateKey: users[0].privKey.serialize(),
850
+ salt: (0, crypto_1.generateRandomSalt)(),
851
+ privateKey: users[0].privateKey.serialize(),
852
852
  signer,
853
853
  });
854
854
  await (0, sdk_1.signup)({
855
855
  maciAddress: maciAddresses.maciContractAddress,
856
- maciPubKey: users[1].pubKey.serialize(),
856
+ maciPublicKey: users[1].publicKey.serialize(),
857
857
  sgData: constants_1.DEFAULT_SG_DATA,
858
858
  signer,
859
859
  });
860
860
  await (0, sdk_1.signup)({
861
861
  maciAddress: maciAddresses.maciContractAddress,
862
- maciPubKey: users[2].pubKey.serialize(),
862
+ maciPublicKey: users[2].publicKey.serialize(),
863
863
  sgData: constants_1.DEFAULT_SG_DATA,
864
864
  signer,
865
865
  });
866
866
  // joinPoll
867
867
  await (0, sdk_1.joinPoll)({
868
868
  maciAddress: maciAddresses.maciContractAddress,
869
- privateKey: users[1].privKey.serialize(),
869
+ privateKey: users[1].privateKey.serialize(),
870
870
  stateIndex: 2n,
871
871
  pollId: 0n,
872
872
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
@@ -882,14 +882,14 @@ describe("e2e tests", function test() {
882
882
  {
883
883
  pollId: 0n,
884
884
  voteOptionIndex: 0n,
885
- salt: (0, crypto_1.genRandomSalt)(),
885
+ salt: (0, crypto_1.generateRandomSalt)(),
886
886
  nonce: 1n,
887
- privateKey: users[1].privKey,
887
+ privateKey: users[1].privateKey,
888
888
  stateIndex: 2n,
889
889
  voteWeight: 2n,
890
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
890
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
891
891
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
892
- newPubKey: users[1].pubKey,
892
+ newPublicKey: users[1].publicKey,
893
893
  },
894
894
  ];
895
895
  const messages = votes
@@ -898,8 +898,8 @@ describe("e2e tests", function test() {
898
898
  maciAddress: maciAddresses.maciContractAddress,
899
899
  poll: 0,
900
900
  data: message.data.map(String),
901
- publicKey: ephemeralKeypair.pubKey.asArray().map(String),
902
- hash: message.hash(ephemeralKeypair.pubKey).toString(),
901
+ publicKey: ephemeralKeypair.publicKey.asArray().map(String),
902
+ hash: message.hash(ephemeralKeypair.publicKey).toString(),
903
903
  }));
904
904
  await (0, utils_1.relayTestMessages)({ messages, signer, pollId: 0, maciAddress: maciAddresses.maciContractAddress });
905
905
  const ipfsMessageBackupFiles = await (0, utils_1.getBackupFilenames)();
@@ -930,7 +930,7 @@ describe("e2e tests", function test() {
930
930
  relayers: [await signer.getAddress()],
931
931
  maciAddress: maciAddresses.maciContractAddress,
932
932
  verifierContractAddress,
933
- vkRegistryContractAddress: vkRegistryAddress,
933
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
934
934
  policyContractAddress: pollPolicyContractAddress,
935
935
  initialVoiceCreditProxyContractAddress,
936
936
  });
@@ -938,13 +938,13 @@ describe("e2e tests", function test() {
938
938
  it("should signup two new users", async () => {
939
939
  await (0, sdk_1.signup)({
940
940
  maciAddress: maciAddresses.maciContractAddress,
941
- maciPubKey: users[3].pubKey.serialize(),
941
+ maciPublicKey: users[3].publicKey.serialize(),
942
942
  sgData: constants_1.DEFAULT_SG_DATA,
943
943
  signer,
944
944
  });
945
945
  await (0, sdk_1.signup)({
946
946
  maciAddress: maciAddresses.maciContractAddress,
947
- maciPubKey: users[4].pubKey.serialize(),
947
+ maciPublicKey: users[4].publicKey.serialize(),
948
948
  sgData: constants_1.DEFAULT_SG_DATA,
949
949
  signer,
950
950
  });
@@ -953,7 +953,7 @@ describe("e2e tests", function test() {
953
953
  // joinPoll
954
954
  await (0, sdk_1.joinPoll)({
955
955
  maciAddress: maciAddresses.maciContractAddress,
956
- privateKey: users[3].privKey.serialize(),
956
+ privateKey: users[3].privateKey.serialize(),
957
957
  stateIndex: 4n,
958
958
  pollId: 1n,
959
959
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
@@ -968,7 +968,7 @@ describe("e2e tests", function test() {
968
968
  // joinPoll
969
969
  await (0, sdk_1.joinPoll)({
970
970
  maciAddress: maciAddresses.maciContractAddress,
971
- privateKey: users[4].privKey.serialize(),
971
+ privateKey: users[4].privateKey.serialize(),
972
972
  stateIndex: 5n,
973
973
  pollId: 1n,
974
974
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
@@ -986,26 +986,26 @@ describe("e2e tests", function test() {
986
986
  {
987
987
  pollId: 1n,
988
988
  voteOptionIndex: 1n,
989
- salt: (0, crypto_1.genRandomSalt)(),
989
+ salt: (0, crypto_1.generateRandomSalt)(),
990
990
  nonce: 1n,
991
- privateKey: users[0].privKey,
991
+ privateKey: users[0].privateKey,
992
992
  stateIndex: 1n,
993
993
  voteWeight: 9n,
994
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
994
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
995
995
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
996
- newPubKey: users[0].pubKey,
996
+ newPublicKey: users[0].publicKey,
997
997
  },
998
998
  {
999
999
  pollId: 1n,
1000
1000
  voteOptionIndex: 0n,
1001
- salt: (0, crypto_1.genRandomSalt)(),
1001
+ salt: (0, crypto_1.generateRandomSalt)(),
1002
1002
  nonce: 1n,
1003
- privateKey: users[1].privKey,
1003
+ privateKey: users[1].privateKey,
1004
1004
  stateIndex: 1n,
1005
1005
  voteWeight: 5n,
1006
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
1006
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
1007
1007
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
1008
- newPubKey: users[1].pubKey,
1008
+ newPublicKey: users[1].publicKey,
1009
1009
  },
1010
1010
  ];
1011
1011
  const messages = votes
@@ -1014,36 +1014,36 @@ describe("e2e tests", function test() {
1014
1014
  maciAddress: maciAddresses.maciContractAddress,
1015
1015
  poll: 1,
1016
1016
  data: message.data.map(String),
1017
- publicKey: ephemeralKeypair.pubKey.asArray().map(String),
1018
- hash: message.hash(ephemeralKeypair.pubKey).toString(),
1017
+ publicKey: ephemeralKeypair.publicKey.asArray().map(String),
1018
+ hash: message.hash(ephemeralKeypair.publicKey).toString(),
1019
1019
  }));
1020
1020
  await (0, utils_1.relayTestMessages)({ messages, signer, pollId: 1, maciAddress: maciAddresses.maciContractAddress });
1021
1021
  });
1022
1022
  it("should publish a new message from the first poll voter", async () => {
1023
1023
  await (0, sdk_1.publish)({
1024
- pubkey: users[0].pubKey.serialize(),
1024
+ publicKey: users[0].publicKey.serialize(),
1025
1025
  stateIndex: 1n,
1026
1026
  voteOptionIndex: 0n,
1027
1027
  nonce: 1n,
1028
1028
  pollId: 1n,
1029
1029
  newVoteWeight: 7n,
1030
1030
  maciAddress: maciAddresses.maciContractAddress,
1031
- salt: (0, crypto_1.genRandomSalt)(),
1032
- privateKey: users[0].privKey.serialize(),
1031
+ salt: (0, crypto_1.generateRandomSalt)(),
1032
+ privateKey: users[0].privateKey.serialize(),
1033
1033
  signer,
1034
1034
  });
1035
1035
  });
1036
1036
  it("should publish a new message by the new poll voters", async () => {
1037
1037
  await (0, sdk_1.publish)({
1038
- pubkey: users[1].pubKey.serialize(),
1038
+ publicKey: users[1].publicKey.serialize(),
1039
1039
  stateIndex: 1n,
1040
1040
  voteOptionIndex: 0n,
1041
1041
  nonce: 1n,
1042
1042
  pollId: 1n,
1043
1043
  newVoteWeight: 7n,
1044
1044
  maciAddress: maciAddresses.maciContractAddress,
1045
- salt: (0, crypto_1.genRandomSalt)(),
1046
- privateKey: users[1].privKey.serialize(),
1045
+ salt: (0, crypto_1.generateRandomSalt)(),
1046
+ privateKey: users[1].privateKey.serialize(),
1047
1047
  signer,
1048
1048
  });
1049
1049
  });
@@ -1098,7 +1098,7 @@ describe("e2e tests", function test() {
1098
1098
  relayers: [await signer.getAddress()],
1099
1099
  maciAddress: maciAddresses.maciContractAddress,
1100
1100
  verifierContractAddress,
1101
- vkRegistryContractAddress: vkRegistryAddress,
1101
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
1102
1102
  policyContractAddress: pollPolicyContractAddress,
1103
1103
  initialVoiceCreditProxyContractAddress,
1104
1104
  });
@@ -1108,14 +1108,14 @@ describe("e2e tests", function test() {
1108
1108
  // eslint-disable-next-line no-await-in-loop
1109
1109
  await (0, sdk_1.signup)({
1110
1110
  maciAddress: maciAddresses.maciContractAddress,
1111
- maciPubKey: users[i].pubKey.serialize(),
1111
+ maciPublicKey: users[i].publicKey.serialize(),
1112
1112
  sgData: constants_1.DEFAULT_SG_DATA,
1113
1113
  signer,
1114
1114
  });
1115
1115
  // eslint-disable-next-line no-await-in-loop
1116
1116
  const { isRegistered, stateIndex } = await (0, sdk_1.getSignedupUserData)({
1117
1117
  maciAddress: maciAddresses.maciContractAddress,
1118
- maciPubKey: users[i].pubKey.serialize(),
1118
+ maciPublicKey: users[i].publicKey.serialize(),
1119
1119
  signer,
1120
1120
  });
1121
1121
  (0, chai_1.expect)(isRegistered).to.eq(true);
@@ -1127,7 +1127,7 @@ describe("e2e tests", function test() {
1127
1127
  // eslint-disable-next-line no-await-in-loop
1128
1128
  await (0, sdk_1.joinPoll)({
1129
1129
  maciAddress: maciAddresses.maciContractAddress,
1130
- privateKey: users[i].privKey.serialize(),
1130
+ privateKey: users[i].privateKey.serialize(),
1131
1131
  stateIndex: BigInt(i + 1),
1132
1132
  pollId: 0n,
1133
1133
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
@@ -1143,7 +1143,7 @@ describe("e2e tests", function test() {
1143
1143
  const { isJoined, pollStateIndex } = await (0, sdk_1.getJoinedUserData)({
1144
1144
  maciAddress: maciAddresses.maciContractAddress,
1145
1145
  pollId: 0n,
1146
- pollPubKey: users[i].pubKey.serialize(),
1146
+ pollPublicKey: users[i].publicKey.serialize(),
1147
1147
  signer,
1148
1148
  startBlock: 0,
1149
1149
  });
@@ -1152,29 +1152,29 @@ describe("e2e tests", function test() {
1152
1152
  }
1153
1153
  // publish
1154
1154
  await (0, sdk_1.publish)({
1155
- pubkey: users[0].pubKey.serialize(),
1155
+ publicKey: users[0].publicKey.serialize(),
1156
1156
  stateIndex: 1n,
1157
1157
  voteOptionIndex: 0n,
1158
1158
  nonce: 1n,
1159
1159
  pollId: 0n,
1160
1160
  newVoteWeight: 9n,
1161
1161
  maciAddress: maciAddresses.maciContractAddress,
1162
- salt: (0, crypto_1.genRandomSalt)(),
1163
- privateKey: users[0].privKey.serialize(),
1162
+ salt: (0, crypto_1.generateRandomSalt)(),
1163
+ privateKey: users[0].privateKey.serialize(),
1164
1164
  signer,
1165
1165
  });
1166
1166
  const votes = [
1167
1167
  {
1168
1168
  pollId: 0n,
1169
1169
  voteOptionIndex: 0n,
1170
- salt: (0, crypto_1.genRandomSalt)(),
1170
+ salt: (0, crypto_1.generateRandomSalt)(),
1171
1171
  nonce: 1n,
1172
- privateKey: users[0].privKey,
1172
+ privateKey: users[0].privateKey,
1173
1173
  stateIndex: 1n,
1174
1174
  voteWeight: 5n,
1175
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
1175
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
1176
1176
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
1177
- newPubKey: users[0].pubKey,
1177
+ newPublicKey: users[0].publicKey,
1178
1178
  },
1179
1179
  ];
1180
1180
  const messages = votes
@@ -1183,8 +1183,8 @@ describe("e2e tests", function test() {
1183
1183
  maciAddress: maciAddresses.maciContractAddress,
1184
1184
  poll: 0,
1185
1185
  data: message.data.map(String),
1186
- publicKey: ephemeralKeypair.pubKey.asArray().map(String),
1187
- hash: message.hash(ephemeralKeypair.pubKey).toString(),
1186
+ publicKey: ephemeralKeypair.publicKey.asArray().map(String),
1187
+ hash: message.hash(ephemeralKeypair.publicKey).toString(),
1188
1188
  }));
1189
1189
  await (0, utils_1.relayTestMessages)({ messages, signer, pollId: 0, maciAddress: maciAddresses.maciContractAddress });
1190
1190
  const ipfsMessageBackupFiles = await (0, utils_1.getBackupFilenames)();
@@ -1216,7 +1216,7 @@ describe("e2e tests", function test() {
1216
1216
  relayers: [await signer.getAddress()],
1217
1217
  maciAddress: maciAddresses.maciContractAddress,
1218
1218
  verifierContractAddress,
1219
- vkRegistryContractAddress: vkRegistryAddress,
1219
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
1220
1220
  policyContractAddress: pollPolicyContractAddress,
1221
1221
  initialVoiceCreditProxyContractAddress,
1222
1222
  });
@@ -1233,7 +1233,7 @@ describe("e2e tests", function test() {
1233
1233
  relayers: [await signer.getAddress()],
1234
1234
  maciAddress: maciAddresses.maciContractAddress,
1235
1235
  verifierContractAddress,
1236
- vkRegistryContractAddress: vkRegistryAddress,
1236
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
1237
1237
  policyContractAddress: pollPolicyContractAddress,
1238
1238
  initialVoiceCreditProxyContractAddress,
1239
1239
  });
@@ -1241,14 +1241,14 @@ describe("e2e tests", function test() {
1241
1241
  });
1242
1242
  it("join the second and third polls", async () => {
1243
1243
  // eslint-disable-next-line @typescript-eslint/prefer-for-of
1244
- for (let p = 1; p <= 2; p += 1) {
1244
+ for (let pollId = 1; pollId <= 2; pollId += 1) {
1245
1245
  for (let i = 0; i < users.length; i += 1) {
1246
1246
  // eslint-disable-next-line no-await-in-loop
1247
1247
  await (0, sdk_1.joinPoll)({
1248
1248
  maciAddress: maciAddresses.maciContractAddress,
1249
- privateKey: users[i].privKey.serialize(),
1249
+ privateKey: users[i].privateKey.serialize(),
1250
1250
  stateIndex: BigInt(i + 1),
1251
- pollId: BigInt(p),
1251
+ pollId: BigInt(pollId),
1252
1252
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
1253
1253
  useWasm: true,
1254
1254
  pollWasm: constants_1.testPollJoiningWasmPath,
@@ -1261,8 +1261,8 @@ describe("e2e tests", function test() {
1261
1261
  // eslint-disable-next-line no-await-in-loop
1262
1262
  const { isJoined, pollStateIndex } = await (0, sdk_1.getJoinedUserData)({
1263
1263
  maciAddress: maciAddresses.maciContractAddress,
1264
- pollId: BigInt(p),
1265
- pollPubKey: users[i].pubKey.serialize(),
1264
+ pollId: BigInt(pollId),
1265
+ pollPublicKey: users[i].publicKey.serialize(),
1266
1266
  signer,
1267
1267
  startBlock: 0,
1268
1268
  });
@@ -1273,39 +1273,39 @@ describe("e2e tests", function test() {
1273
1273
  });
1274
1274
  it("should publish messages to the second poll", async () => {
1275
1275
  await (0, sdk_1.publish)({
1276
- pubkey: users[0].pubKey.serialize(),
1276
+ publicKey: users[0].publicKey.serialize(),
1277
1277
  stateIndex: 1n,
1278
1278
  voteOptionIndex: 0n,
1279
1279
  nonce: 1n,
1280
1280
  pollId: 1n,
1281
1281
  newVoteWeight: 9n,
1282
1282
  maciAddress: maciAddresses.maciContractAddress,
1283
- salt: (0, crypto_1.genRandomSalt)(),
1284
- privateKey: users[0].privKey.serialize(),
1283
+ salt: (0, crypto_1.generateRandomSalt)(),
1284
+ privateKey: users[0].privateKey.serialize(),
1285
1285
  signer,
1286
1286
  });
1287
1287
  await (0, sdk_1.publish)({
1288
- pubkey: users[1].pubKey.serialize(),
1288
+ publicKey: users[1].publicKey.serialize(),
1289
1289
  stateIndex: 2n,
1290
1290
  voteOptionIndex: 3n,
1291
1291
  nonce: 1n,
1292
1292
  pollId: 1n,
1293
1293
  newVoteWeight: 1n,
1294
1294
  maciAddress: maciAddresses.maciContractAddress,
1295
- salt: (0, crypto_1.genRandomSalt)(),
1296
- privateKey: users[1].privKey.serialize(),
1295
+ salt: (0, crypto_1.generateRandomSalt)(),
1296
+ privateKey: users[1].privateKey.serialize(),
1297
1297
  signer,
1298
1298
  });
1299
1299
  await (0, sdk_1.publish)({
1300
- pubkey: users[2].pubKey.serialize(),
1300
+ publicKey: users[2].publicKey.serialize(),
1301
1301
  stateIndex: 3n,
1302
1302
  voteOptionIndex: 5n,
1303
1303
  nonce: 1n,
1304
1304
  pollId: 1n,
1305
1305
  newVoteWeight: 3n,
1306
1306
  maciAddress: maciAddresses.maciContractAddress,
1307
- salt: (0, crypto_1.genRandomSalt)(),
1308
- privateKey: users[2].privKey.serialize(),
1307
+ salt: (0, crypto_1.generateRandomSalt)(),
1308
+ privateKey: users[2].privateKey.serialize(),
1309
1309
  signer,
1310
1310
  });
1311
1311
  });
@@ -1314,14 +1314,14 @@ describe("e2e tests", function test() {
1314
1314
  {
1315
1315
  pollId: 1n,
1316
1316
  voteOptionIndex: 0n,
1317
- salt: (0, crypto_1.genRandomSalt)(),
1317
+ salt: (0, crypto_1.generateRandomSalt)(),
1318
1318
  nonce: 1n,
1319
- privateKey: users[0].privKey,
1319
+ privateKey: users[0].privateKey,
1320
1320
  stateIndex: 1n,
1321
1321
  voteWeight: 3n,
1322
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
1322
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
1323
1323
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
1324
- newPubKey: users[0].pubKey,
1324
+ newPublicKey: users[0].publicKey,
1325
1325
  },
1326
1326
  ];
1327
1327
  const messages = votes
@@ -1330,8 +1330,8 @@ describe("e2e tests", function test() {
1330
1330
  maciAddress: maciAddresses.maciContractAddress,
1331
1331
  poll: 1,
1332
1332
  data: message.data.map(String),
1333
- publicKey: ephemeralKeypair.pubKey.asArray().map(String),
1334
- hash: message.hash(ephemeralKeypair.pubKey).toString(),
1333
+ publicKey: ephemeralKeypair.publicKey.asArray().map(String),
1334
+ hash: message.hash(ephemeralKeypair.publicKey).toString(),
1335
1335
  }));
1336
1336
  await (0, utils_1.relayTestMessages)({ messages, signer, pollId: 1, maciAddress: maciAddresses.maciContractAddress });
1337
1337
  });
@@ -1340,26 +1340,26 @@ describe("e2e tests", function test() {
1340
1340
  {
1341
1341
  pollId: 2n,
1342
1342
  voteOptionIndex: 7n,
1343
- salt: (0, crypto_1.genRandomSalt)(),
1343
+ salt: (0, crypto_1.generateRandomSalt)(),
1344
1344
  nonce: 1n,
1345
- privateKey: users[4].privKey,
1345
+ privateKey: users[4].privateKey,
1346
1346
  stateIndex: 4n,
1347
1347
  voteWeight: 3n,
1348
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
1348
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
1349
1349
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
1350
- newPubKey: users[4].pubKey,
1350
+ newPublicKey: users[4].publicKey,
1351
1351
  },
1352
1352
  {
1353
1353
  pollId: 2n,
1354
1354
  voteOptionIndex: 5n,
1355
- salt: (0, crypto_1.genRandomSalt)(),
1355
+ salt: (0, crypto_1.generateRandomSalt)(),
1356
1356
  nonce: 1n,
1357
- privateKey: users[5].privKey,
1357
+ privateKey: users[5].privateKey,
1358
1358
  stateIndex: 5n,
1359
1359
  voteWeight: 4n,
1360
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
1360
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
1361
1361
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
1362
- newPubKey: users[5].pubKey,
1362
+ newPublicKey: users[5].publicKey,
1363
1363
  },
1364
1364
  ];
1365
1365
  const messages = votes
@@ -1368,46 +1368,46 @@ describe("e2e tests", function test() {
1368
1368
  maciAddress: maciAddresses.maciContractAddress,
1369
1369
  poll: 2,
1370
1370
  data: message.data.map(String),
1371
- publicKey: ephemeralKeypair.pubKey.asArray().map(String),
1372
- hash: message.hash(ephemeralKeypair.pubKey).toString(),
1371
+ publicKey: ephemeralKeypair.publicKey.asArray().map(String),
1372
+ hash: message.hash(ephemeralKeypair.publicKey).toString(),
1373
1373
  }));
1374
1374
  await (0, utils_1.relayTestMessages)({ messages, signer, pollId: 2, maciAddress: maciAddresses.maciContractAddress });
1375
1375
  });
1376
1376
  it("should publish messages to the third poll", async () => {
1377
1377
  await (0, sdk_1.publish)({
1378
- pubkey: users[3].pubKey.serialize(),
1378
+ publicKey: users[3].publicKey.serialize(),
1379
1379
  stateIndex: 3n,
1380
1380
  voteOptionIndex: 5n,
1381
1381
  nonce: 1n,
1382
1382
  pollId: 2n,
1383
1383
  newVoteWeight: 3n,
1384
1384
  maciAddress: maciAddresses.maciContractAddress,
1385
- salt: (0, crypto_1.genRandomSalt)(),
1386
- privateKey: users[3].privKey.serialize(),
1385
+ salt: (0, crypto_1.generateRandomSalt)(),
1386
+ privateKey: users[3].privateKey.serialize(),
1387
1387
  signer,
1388
1388
  });
1389
1389
  await (0, sdk_1.publish)({
1390
- pubkey: users[4].pubKey.serialize(),
1390
+ publicKey: users[4].publicKey.serialize(),
1391
1391
  stateIndex: 4n,
1392
1392
  voteOptionIndex: 7n,
1393
1393
  nonce: 1n,
1394
1394
  pollId: 2n,
1395
1395
  newVoteWeight: 2n,
1396
1396
  maciAddress: maciAddresses.maciContractAddress,
1397
- salt: (0, crypto_1.genRandomSalt)(),
1398
- privateKey: users[4].privKey.serialize(),
1397
+ salt: (0, crypto_1.generateRandomSalt)(),
1398
+ privateKey: users[4].privateKey.serialize(),
1399
1399
  signer,
1400
1400
  });
1401
1401
  await (0, sdk_1.publish)({
1402
- pubkey: users[5].pubKey.serialize(),
1402
+ publicKey: users[5].publicKey.serialize(),
1403
1403
  stateIndex: 5n,
1404
1404
  voteOptionIndex: 5n,
1405
1405
  nonce: 1n,
1406
1406
  pollId: 2n,
1407
1407
  newVoteWeight: 9n,
1408
1408
  maciAddress: maciAddresses.maciContractAddress,
1409
- salt: (0, crypto_1.genRandomSalt)(),
1410
- privateKey: users[5].privKey.serialize(),
1409
+ salt: (0, crypto_1.generateRandomSalt)(),
1410
+ privateKey: users[5].privateKey.serialize(),
1411
1411
  signer,
1412
1412
  });
1413
1413
  });
@@ -1490,7 +1490,7 @@ describe("e2e tests", function test() {
1490
1490
  relayers: [await signer.getAddress()],
1491
1491
  maciAddress: maciAddresses.maciContractAddress,
1492
1492
  verifierContractAddress,
1493
- vkRegistryContractAddress: vkRegistryAddress,
1493
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
1494
1494
  policyContractAddress: pollPolicyContractAddress,
1495
1495
  initialVoiceCreditProxyContractAddress,
1496
1496
  });
@@ -1498,7 +1498,7 @@ describe("e2e tests", function test() {
1498
1498
  it("should signup one user", async () => {
1499
1499
  await (0, sdk_1.signup)({
1500
1500
  maciAddress: maciAddresses.maciContractAddress,
1501
- maciPubKey: user.pubKey.serialize(),
1501
+ maciPublicKey: user.publicKey.serialize(),
1502
1502
  sgData: constants_1.DEFAULT_SG_DATA,
1503
1503
  signer,
1504
1504
  });
@@ -1507,7 +1507,7 @@ describe("e2e tests", function test() {
1507
1507
  // joinPoll
1508
1508
  await (0, sdk_1.joinPoll)({
1509
1509
  maciAddress: maciAddresses.maciContractAddress,
1510
- privateKey: user.privKey.serialize(),
1510
+ privateKey: user.privateKey.serialize(),
1511
1511
  stateIndex: 1n,
1512
1512
  pollId: 0n,
1513
1513
  pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
@@ -1522,15 +1522,15 @@ describe("e2e tests", function test() {
1522
1522
  });
1523
1523
  it("should publish one message", async () => {
1524
1524
  await (0, sdk_1.publish)({
1525
- pubkey: user.pubKey.serialize(),
1525
+ publicKey: user.publicKey.serialize(),
1526
1526
  stateIndex: 1n,
1527
1527
  voteOptionIndex: 5n,
1528
1528
  nonce: 1n,
1529
1529
  pollId: 0n,
1530
1530
  newVoteWeight: 3n,
1531
1531
  maciAddress: maciAddresses.maciContractAddress,
1532
- salt: (0, crypto_1.genRandomSalt)(),
1533
- privateKey: user.privKey.serialize(),
1532
+ salt: (0, crypto_1.generateRandomSalt)(),
1533
+ privateKey: user.privateKey.serialize(),
1534
1534
  signer,
1535
1535
  });
1536
1536
  });
@@ -1539,14 +1539,14 @@ describe("e2e tests", function test() {
1539
1539
  {
1540
1540
  pollId: 0n,
1541
1541
  voteOptionIndex: 5n,
1542
- salt: (0, crypto_1.genRandomSalt)(),
1542
+ salt: (0, crypto_1.generateRandomSalt)(),
1543
1543
  nonce: 1n,
1544
- privateKey: user.privKey,
1544
+ privateKey: user.privateKey,
1545
1545
  stateIndex: 1n,
1546
1546
  voteWeight: 5n,
1547
- coordinatorPubKey: constants_1.coordinatorKeypair.pubKey,
1547
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
1548
1548
  maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
1549
- newPubKey: user.pubKey,
1549
+ newPublicKey: user.publicKey,
1550
1550
  },
1551
1551
  ];
1552
1552
  const messages = votes
@@ -1555,8 +1555,8 @@ describe("e2e tests", function test() {
1555
1555
  maciAddress: maciAddresses.maciContractAddress,
1556
1556
  poll: 0,
1557
1557
  data: message.data.map(String),
1558
- publicKey: ephemeralKeypair.pubKey.asArray().map(String),
1559
- hash: message.hash(ephemeralKeypair.pubKey).toString(),
1558
+ publicKey: ephemeralKeypair.publicKey.asArray().map(String),
1559
+ hash: message.hash(ephemeralKeypair.publicKey).toString(),
1560
1560
  }));
1561
1561
  await (0, utils_1.relayTestMessages)({ messages, signer, pollId: 0, maciAddress: maciAddresses.maciContractAddress });
1562
1562
  });
@@ -1567,7 +1567,7 @@ describe("e2e tests", function test() {
1567
1567
  await (0, sdk_1.generateMaciState)({
1568
1568
  maciAddress: maciAddresses.maciContractAddress,
1569
1569
  outputPath: stateOutPath,
1570
- coordinatorPrivateKey: constants_1.coordinatorPrivKey,
1570
+ coordinatorPrivateKey: constants_1.coordinatorPrivateKey,
1571
1571
  blockPerBatch: 50,
1572
1572
  pollId: 0n,
1573
1573
  signer,