@maci-protocol/testing 0.0.0-ci.fb960ed → 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.
- package/LICENSE +1 -2
- package/build/ts/__tests__/e2e.nonQv.test.js +11 -11
- package/build/ts/__tests__/e2e.nonQv.test.js.map +1 -1
- package/build/ts/__tests__/e2e.test.js +62 -62
- package/build/ts/__tests__/e2e.test.js.map +1 -1
- package/build/ts/__tests__/integration.test.js +14 -14
- package/build/ts/__tests__/integration.test.js.map +1 -1
- package/build/ts/__tests__/keyChange.test.js +21 -21
- package/build/ts/__tests__/keyChange.test.js.map +1 -1
- package/build/ts/__tests__/maciKeys.test.js +32 -32
- package/build/ts/__tests__/maciKeys.test.js.map +1 -1
- package/build/ts/__tests__/unit/joinPoll.test.js +5 -5
- package/build/ts/__tests__/unit/joinPoll.test.js.map +1 -1
- package/build/ts/__tests__/unit/poll.test.js +5 -5
- package/build/ts/__tests__/unit/poll.test.js.map +1 -1
- package/build/ts/__tests__/unit/publish.test.js +5 -5
- package/build/ts/__tests__/unit/publish.test.js.map +1 -1
- package/build/ts/__tests__/unit/signup.test.js +4 -4
- package/build/ts/__tests__/unit/signup.test.js.map +1 -1
- package/build/ts/__tests__/unit/utils.test.js +12 -12
- package/build/ts/__tests__/unit/utils.test.js.map +1 -1
- package/build/ts/constants.d.ts +3 -3
- package/build/ts/constants.d.ts.map +1 -1
- package/build/ts/constants.js +6 -6
- package/build/ts/constants.js.map +1 -1
- package/build/ts/testingClass.d.ts.map +1 -1
- package/build/ts/testingClass.js +9 -9
- package/build/ts/testingClass.js.map +1 -1
- package/build/ts/types.d.ts +4 -4
- package/build/ts/types.d.ts.map +1 -1
- package/build/ts/utils.d.ts +2 -2
- package/build/ts/utils.d.ts.map +1 -1
- package/build/ts/utils.js +4 -4
- package/build/ts/utils.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
package/LICENSE
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
4
|
-
Cory Dickson, Han Jian, Chih-Cheng Liang, and Koh Wei Jie
|
|
3
|
+
Copyright (c) 2025 Ethereum Foundation
|
|
5
4
|
|
|
6
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -18,7 +18,7 @@ describe("e2e tests with non quadratic voting", function test() {
|
|
|
18
18
|
let initialVoiceCreditProxyContractAddress;
|
|
19
19
|
let verifierContractAddress;
|
|
20
20
|
let signer;
|
|
21
|
-
let
|
|
21
|
+
let verifyingKeysRegistryAddress;
|
|
22
22
|
const generateProofsArgs = {
|
|
23
23
|
outputDir: constants_1.testProofsDirPath,
|
|
24
24
|
tallyFile: constants_1.testTallyFilePath,
|
|
@@ -36,19 +36,19 @@ describe("e2e tests with non quadratic voting", function test() {
|
|
|
36
36
|
useWasm,
|
|
37
37
|
useQuadraticVoting: false,
|
|
38
38
|
};
|
|
39
|
-
// before all tests we deploy the
|
|
39
|
+
// before all tests we deploy the verifying keys registry contract and set the verifying keys
|
|
40
40
|
before(async () => {
|
|
41
41
|
signer = await (0, sdk_1.getDefaultSigner)();
|
|
42
|
-
// we deploy the
|
|
43
|
-
|
|
42
|
+
// we deploy the verifying keys registry contract
|
|
43
|
+
verifyingKeysRegistryAddress = await (0, sdk_1.deployVerifyingKeysRegistryContract)({ signer });
|
|
44
44
|
const [initialVoiceCreditProxy] = await (0, sdk_1.deployConstantInitialVoiceCreditProxy)({ amount: constants_1.DEFAULT_INITIAL_VOICE_CREDITS }, signer, undefined, true);
|
|
45
45
|
initialVoiceCreditProxyContractAddress = await initialVoiceCreditProxy.getAddress();
|
|
46
46
|
const verifier = await (0, sdk_1.deployVerifier)(signer, true);
|
|
47
47
|
verifierContractAddress = await verifier.getAddress();
|
|
48
|
-
// we deploy the
|
|
49
|
-
|
|
48
|
+
// we deploy the verifying keys registry contract
|
|
49
|
+
verifyingKeysRegistryAddress = await (0, sdk_1.deployVerifyingKeysRegistryContract)({ signer });
|
|
50
50
|
// we set the verifying keys
|
|
51
|
-
await (0, sdk_1.setVerifyingKeys)({ ...(await (0, constants_1.verifyingKeysArgs)(signer, sdk_1.EMode.NON_QV)),
|
|
51
|
+
await (0, sdk_1.setVerifyingKeys)({ ...(await (0, constants_1.verifyingKeysArgs)(signer, sdk_1.EMode.NON_QV)), verifyingKeysRegistryAddress });
|
|
52
52
|
});
|
|
53
53
|
describe("1 signup, 1 message", () => {
|
|
54
54
|
after(async () => {
|
|
@@ -76,7 +76,7 @@ describe("e2e tests with non quadratic voting", function test() {
|
|
|
76
76
|
relayers: [await signer.getAddress()],
|
|
77
77
|
maciAddress: maciAddresses.maciContractAddress,
|
|
78
78
|
verifierContractAddress,
|
|
79
|
-
|
|
79
|
+
verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
|
|
80
80
|
policyContractAddress: pollPolicyContractAddress,
|
|
81
81
|
initialVoiceCreditProxyContractAddress,
|
|
82
82
|
mode: sdk_1.EMode.NON_QV,
|
|
@@ -99,7 +99,7 @@ describe("e2e tests with non quadratic voting", function test() {
|
|
|
99
99
|
pollId: 0n,
|
|
100
100
|
newVoteWeight: 9n,
|
|
101
101
|
maciAddress: maciAddresses.maciContractAddress,
|
|
102
|
-
salt: (0, crypto_1.
|
|
102
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
103
103
|
privateKey: user.privateKey.serialize(),
|
|
104
104
|
signer,
|
|
105
105
|
});
|
|
@@ -147,7 +147,7 @@ describe("e2e tests with non quadratic voting", function test() {
|
|
|
147
147
|
relayers: [await signer.getAddress()],
|
|
148
148
|
maciAddress: maciAddresses.maciContractAddress,
|
|
149
149
|
verifierContractAddress,
|
|
150
|
-
|
|
150
|
+
verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
|
|
151
151
|
policyContractAddress: pollPolicyContractAddress,
|
|
152
152
|
initialVoiceCreditProxyContractAddress,
|
|
153
153
|
mode: sdk_1.EMode.NON_QV,
|
|
@@ -165,7 +165,7 @@ describe("e2e tests with non quadratic voting", function test() {
|
|
|
165
165
|
const { message, ephemeralKeypair } = (0, sdk_1.generateVote)({
|
|
166
166
|
pollId: 0n,
|
|
167
167
|
voteOptionIndex: 0n,
|
|
168
|
-
salt: (0, crypto_1.
|
|
168
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
169
169
|
nonce: 1n,
|
|
170
170
|
privateKey: user.privateKey,
|
|
171
171
|
stateIndex: 1n,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e.nonQv.test.js","sourceRoot":"","sources":["../../../ts/__tests__/e2e.nonQv.test.ts"],"names":[],"mappings":";;AAAA,8CAA6D;AAC7D,
|
|
1
|
+
{"version":3,"file":"e2e.nonQv.test.js","sourceRoot":"","sources":["../../../ts/__tests__/e2e.nonQv.test.ts"],"names":[],"mappings":";;AAAA,8CAA6D;AAC7D,kDAA2D;AAC3D,0DAAoD;AACpD,4CAsB4B;AAI5B,4CAuBsB;AACtB,oCAAwE;AAExE;;;;GAIG;AACH,QAAQ,CAAC,qCAAqC,EAAE,SAAS,IAAI;IAC3D,MAAM,OAAO,GAAG,IAAA,WAAK,GAAE,CAAC;IACxB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAErB,IAAI,aAA6B,CAAC;IAClC,IAAI,sCAA8C,CAAC;IACnD,IAAI,uBAA+B,CAAC;IACpC,IAAI,MAAc,CAAC;IACnB,IAAI,4BAAoC,CAAC;IAEzC,MAAM,kBAAkB,GAAwD;QAC9E,SAAS,EAAE,6BAAiB;QAC5B,SAAS,EAAE,6BAAiB;QAC5B,SAAS,EAAE,uCAA2B;QACtC,WAAW,EAAE,2CAA+B;QAC5C,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,8BAAkB;QAC9B,aAAa,EAAE,+CAAmC;QAClD,cAAc,EAAE,kDAAs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yingKeysRegistryAddress;
|
|
31
31
|
let initialVoiceCreditProxyContractAddress;
|
|
32
32
|
let verifierContractAddress;
|
|
33
33
|
let signer;
|
|
@@ -48,17 +48,17 @@ describe("e2e tests", function test() {
|
|
|
48
48
|
useWasm,
|
|
49
49
|
useQuadraticVoting: true,
|
|
50
50
|
};
|
|
51
|
-
// before all tests we deploy the
|
|
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
|
|
55
|
-
|
|
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)),
|
|
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
|
-
|
|
89
|
+
verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
|
|
90
90
|
policyContractAddress: pollPolicyContractAddress,
|
|
91
91
|
initialVoiceCreditProxyContractAddress,
|
|
92
92
|
});
|
|
@@ -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.
|
|
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
|
-
|
|
180
|
+
verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
|
|
181
181
|
policyContractAddress: pollPolicyContractAddress,
|
|
182
182
|
initialVoiceCreditProxyContractAddress,
|
|
183
183
|
});
|
|
@@ -223,7 +223,7 @@ describe("e2e tests", function test() {
|
|
|
223
223
|
pollId: 0n,
|
|
224
224
|
newVoteWeight: 4n,
|
|
225
225
|
maciAddress: maciAddresses.maciContractAddress,
|
|
226
|
-
salt: (0, crypto_1.
|
|
226
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
227
227
|
privateKey: users[0].privateKey.serialize(),
|
|
228
228
|
signer,
|
|
229
229
|
});
|
|
@@ -235,7 +235,7 @@ describe("e2e tests", function test() {
|
|
|
235
235
|
pollId: 0n,
|
|
236
236
|
newVoteWeight: 3n,
|
|
237
237
|
maciAddress: maciAddresses.maciContractAddress,
|
|
238
|
-
salt: (0, crypto_1.
|
|
238
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
239
239
|
privateKey: users[0].privateKey.serialize(),
|
|
240
240
|
signer,
|
|
241
241
|
});
|
|
@@ -247,7 +247,7 @@ describe("e2e tests", function test() {
|
|
|
247
247
|
pollId: 0n,
|
|
248
248
|
newVoteWeight: 9n,
|
|
249
249
|
maciAddress: maciAddresses.maciContractAddress,
|
|
250
|
-
salt: (0, crypto_1.
|
|
250
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
251
251
|
privateKey: users[0].privateKey.serialize(),
|
|
252
252
|
signer,
|
|
253
253
|
});
|
|
@@ -259,7 +259,7 @@ describe("e2e tests", function test() {
|
|
|
259
259
|
pollId: 0n,
|
|
260
260
|
newVoteWeight: 9n,
|
|
261
261
|
maciAddress: maciAddresses.maciContractAddress,
|
|
262
|
-
salt: (0, crypto_1.
|
|
262
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
263
263
|
privateKey: users[1].privateKey.serialize(),
|
|
264
264
|
signer,
|
|
265
265
|
});
|
|
@@ -271,7 +271,7 @@ describe("e2e tests", function test() {
|
|
|
271
271
|
pollId: 0n,
|
|
272
272
|
newVoteWeight: 9n,
|
|
273
273
|
maciAddress: maciAddresses.maciContractAddress,
|
|
274
|
-
salt: (0, crypto_1.
|
|
274
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
275
275
|
privateKey: users[2].privateKey.serialize(),
|
|
276
276
|
signer,
|
|
277
277
|
});
|
|
@@ -283,7 +283,7 @@ describe("e2e tests", function test() {
|
|
|
283
283
|
pollId: 0n,
|
|
284
284
|
newVoteWeight: 3n,
|
|
285
285
|
maciAddress: maciAddresses.maciContractAddress,
|
|
286
|
-
salt: (0, crypto_1.
|
|
286
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
287
287
|
privateKey: users[3].privateKey.serialize(),
|
|
288
288
|
signer,
|
|
289
289
|
});
|
|
@@ -295,7 +295,7 @@ describe("e2e tests", function test() {
|
|
|
295
295
|
pollId: 0n,
|
|
296
296
|
newVoteWeight: 2n,
|
|
297
297
|
maciAddress: maciAddresses.maciContractAddress,
|
|
298
|
-
salt: (0, crypto_1.
|
|
298
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
299
299
|
privateKey: users[3].privateKey.serialize(),
|
|
300
300
|
signer,
|
|
301
301
|
});
|
|
@@ -307,7 +307,7 @@ describe("e2e tests", function test() {
|
|
|
307
307
|
pollId: 0n,
|
|
308
308
|
newVoteWeight: 9n,
|
|
309
309
|
maciAddress: maciAddresses.maciContractAddress,
|
|
310
|
-
salt: (0, crypto_1.
|
|
310
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
311
311
|
privateKey: users[3].privateKey.serialize(),
|
|
312
312
|
signer,
|
|
313
313
|
});
|
|
@@ -317,7 +317,7 @@ describe("e2e tests", function test() {
|
|
|
317
317
|
{
|
|
318
318
|
pollId: 0n,
|
|
319
319
|
voteOptionIndex: 1n,
|
|
320
|
-
salt: (0, crypto_1.
|
|
320
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
321
321
|
nonce: 2n,
|
|
322
322
|
privateKey: users[0].privateKey,
|
|
323
323
|
stateIndex: 1n,
|
|
@@ -329,7 +329,7 @@ describe("e2e tests", function test() {
|
|
|
329
329
|
{
|
|
330
330
|
pollId: 0n,
|
|
331
331
|
voteOptionIndex: 1n,
|
|
332
|
-
salt: (0, crypto_1.
|
|
332
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
333
333
|
nonce: 2n,
|
|
334
334
|
privateKey: users[0].privateKey,
|
|
335
335
|
stateIndex: 1n,
|
|
@@ -341,7 +341,7 @@ describe("e2e tests", function test() {
|
|
|
341
341
|
{
|
|
342
342
|
pollId: 0n,
|
|
343
343
|
voteOptionIndex: 1n,
|
|
344
|
-
salt: (0, crypto_1.
|
|
344
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
345
345
|
nonce: 1n,
|
|
346
346
|
privateKey: users[0].privateKey,
|
|
347
347
|
stateIndex: 1n,
|
|
@@ -353,7 +353,7 @@ describe("e2e tests", function test() {
|
|
|
353
353
|
{
|
|
354
354
|
pollId: 0n,
|
|
355
355
|
voteOptionIndex: 1n,
|
|
356
|
-
salt: (0, crypto_1.
|
|
356
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
357
357
|
nonce: 1n,
|
|
358
358
|
privateKey: users[1].privateKey,
|
|
359
359
|
stateIndex: 2n,
|
|
@@ -365,7 +365,7 @@ describe("e2e tests", function test() {
|
|
|
365
365
|
{
|
|
366
366
|
pollId: 0n,
|
|
367
367
|
voteOptionIndex: 1n,
|
|
368
|
-
salt: (0, crypto_1.
|
|
368
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
369
369
|
nonce: 1n,
|
|
370
370
|
privateKey: users[2].privateKey,
|
|
371
371
|
stateIndex: 3n,
|
|
@@ -377,7 +377,7 @@ describe("e2e tests", function test() {
|
|
|
377
377
|
{
|
|
378
378
|
pollId: 0n,
|
|
379
379
|
voteOptionIndex: 0n,
|
|
380
|
-
salt: (0, crypto_1.
|
|
380
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
381
381
|
nonce: 3n,
|
|
382
382
|
privateKey: users[3].privateKey,
|
|
383
383
|
stateIndex: 4n,
|
|
@@ -389,7 +389,7 @@ describe("e2e tests", function test() {
|
|
|
389
389
|
{
|
|
390
390
|
pollId: 0n,
|
|
391
391
|
voteOptionIndex: 0n,
|
|
392
|
-
salt: (0, crypto_1.
|
|
392
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
393
393
|
nonce: 2n,
|
|
394
394
|
privateKey: users[3].privateKey,
|
|
395
395
|
stateIndex: 4n,
|
|
@@ -401,7 +401,7 @@ describe("e2e tests", function test() {
|
|
|
401
401
|
{
|
|
402
402
|
pollId: 0n,
|
|
403
403
|
voteOptionIndex: 0n,
|
|
404
|
-
salt: (0, crypto_1.
|
|
404
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
405
405
|
nonce: 1n,
|
|
406
406
|
privateKey: users[3].privateKey,
|
|
407
407
|
stateIndex: 4n,
|
|
@@ -462,7 +462,7 @@ describe("e2e tests", function test() {
|
|
|
462
462
|
relayers: [await signer.getAddress()],
|
|
463
463
|
maciAddress: maciAddresses.maciContractAddress,
|
|
464
464
|
verifierContractAddress,
|
|
465
|
-
|
|
465
|
+
verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
|
|
466
466
|
policyContractAddress: pollPolicyContractAddress,
|
|
467
467
|
initialVoiceCreditProxyContractAddress,
|
|
468
468
|
});
|
|
@@ -501,7 +501,7 @@ 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.
|
|
504
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
505
505
|
nonce: 1n,
|
|
506
506
|
privateKey: users[0].privateKey,
|
|
507
507
|
stateIndex: 1n,
|
|
@@ -528,7 +528,7 @@ describe("e2e tests", function test() {
|
|
|
528
528
|
pollId: 0n,
|
|
529
529
|
newVoteWeight: 9n,
|
|
530
530
|
maciAddress: maciAddresses.maciContractAddress,
|
|
531
|
-
salt: (0, crypto_1.
|
|
531
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
532
532
|
privateKey: users[0].privateKey.serialize(),
|
|
533
533
|
signer,
|
|
534
534
|
});
|
|
@@ -574,7 +574,7 @@ describe("e2e tests", function test() {
|
|
|
574
574
|
relayers: [await signer.getAddress()],
|
|
575
575
|
maciAddress: maciAddresses.maciContractAddress,
|
|
576
576
|
verifierContractAddress,
|
|
577
|
-
|
|
577
|
+
verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
|
|
578
578
|
policyContractAddress: pollPolicyContractAddress,
|
|
579
579
|
initialVoiceCreditProxyContractAddress,
|
|
580
580
|
});
|
|
@@ -623,7 +623,7 @@ describe("e2e tests", function test() {
|
|
|
623
623
|
nonce: 1n,
|
|
624
624
|
pollId: 0n,
|
|
625
625
|
newVoteWeight: 9n,
|
|
626
|
-
salt: (0, crypto_1.
|
|
626
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
627
627
|
privateKey: users[i].privateKey.serialize(),
|
|
628
628
|
signer,
|
|
629
629
|
});
|
|
@@ -667,7 +667,7 @@ describe("e2e tests", function test() {
|
|
|
667
667
|
relayers: [await signer.getAddress()],
|
|
668
668
|
maciAddress: maciAddresses.maciContractAddress,
|
|
669
669
|
verifierContractAddress,
|
|
670
|
-
|
|
670
|
+
verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
|
|
671
671
|
policyContractAddress: pollPolicyContractAddress,
|
|
672
672
|
initialVoiceCreditProxyContractAddress,
|
|
673
673
|
});
|
|
@@ -716,7 +716,7 @@ describe("e2e tests", function test() {
|
|
|
716
716
|
nonce: 1n,
|
|
717
717
|
pollId: 0n,
|
|
718
718
|
newVoteWeight: 9n,
|
|
719
|
-
salt: (0, crypto_1.
|
|
719
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
720
720
|
privateKey: users[i].privateKey.serialize(),
|
|
721
721
|
signer,
|
|
722
722
|
});
|
|
@@ -727,7 +727,7 @@ describe("e2e tests", function test() {
|
|
|
727
727
|
{
|
|
728
728
|
pollId: 0n,
|
|
729
729
|
voteOptionIndex: 1n,
|
|
730
|
-
salt: (0, crypto_1.
|
|
730
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
731
731
|
nonce: 2n,
|
|
732
732
|
privateKey: users[0].privateKey,
|
|
733
733
|
stateIndex: 1n,
|
|
@@ -739,7 +739,7 @@ describe("e2e tests", function test() {
|
|
|
739
739
|
{
|
|
740
740
|
pollId: 0n,
|
|
741
741
|
voteOptionIndex: 2n,
|
|
742
|
-
salt: (0, crypto_1.
|
|
742
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
743
743
|
nonce: 3n,
|
|
744
744
|
privateKey: users[2].privateKey,
|
|
745
745
|
stateIndex: 3n,
|
|
@@ -751,7 +751,7 @@ describe("e2e tests", function test() {
|
|
|
751
751
|
{
|
|
752
752
|
pollId: 0n,
|
|
753
753
|
voteOptionIndex: 3n,
|
|
754
|
-
salt: (0, crypto_1.
|
|
754
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
755
755
|
nonce: 3n,
|
|
756
756
|
privateKey: users[3].privateKey,
|
|
757
757
|
stateIndex: 4n,
|
|
@@ -812,7 +812,7 @@ describe("e2e tests", function test() {
|
|
|
812
812
|
relayers: [await signer.getAddress()],
|
|
813
813
|
maciAddress: maciAddresses.maciContractAddress,
|
|
814
814
|
verifierContractAddress,
|
|
815
|
-
|
|
815
|
+
verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
|
|
816
816
|
policyContractAddress: pollPolicyContractAddress,
|
|
817
817
|
initialVoiceCreditProxyContractAddress,
|
|
818
818
|
});
|
|
@@ -847,7 +847,7 @@ describe("e2e tests", function test() {
|
|
|
847
847
|
pollId: 0n,
|
|
848
848
|
newVoteWeight: 9n,
|
|
849
849
|
maciAddress: maciAddresses.maciContractAddress,
|
|
850
|
-
salt: (0, crypto_1.
|
|
850
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
851
851
|
privateKey: users[0].privateKey.serialize(),
|
|
852
852
|
signer,
|
|
853
853
|
});
|
|
@@ -882,7 +882,7 @@ describe("e2e tests", function test() {
|
|
|
882
882
|
{
|
|
883
883
|
pollId: 0n,
|
|
884
884
|
voteOptionIndex: 0n,
|
|
885
|
-
salt: (0, crypto_1.
|
|
885
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
886
886
|
nonce: 1n,
|
|
887
887
|
privateKey: users[1].privateKey,
|
|
888
888
|
stateIndex: 2n,
|
|
@@ -930,7 +930,7 @@ describe("e2e tests", function test() {
|
|
|
930
930
|
relayers: [await signer.getAddress()],
|
|
931
931
|
maciAddress: maciAddresses.maciContractAddress,
|
|
932
932
|
verifierContractAddress,
|
|
933
|
-
|
|
933
|
+
verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
|
|
934
934
|
policyContractAddress: pollPolicyContractAddress,
|
|
935
935
|
initialVoiceCreditProxyContractAddress,
|
|
936
936
|
});
|
|
@@ -986,7 +986,7 @@ describe("e2e tests", function test() {
|
|
|
986
986
|
{
|
|
987
987
|
pollId: 1n,
|
|
988
988
|
voteOptionIndex: 1n,
|
|
989
|
-
salt: (0, crypto_1.
|
|
989
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
990
990
|
nonce: 1n,
|
|
991
991
|
privateKey: users[0].privateKey,
|
|
992
992
|
stateIndex: 1n,
|
|
@@ -998,7 +998,7 @@ describe("e2e tests", function test() {
|
|
|
998
998
|
{
|
|
999
999
|
pollId: 1n,
|
|
1000
1000
|
voteOptionIndex: 0n,
|
|
1001
|
-
salt: (0, crypto_1.
|
|
1001
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1002
1002
|
nonce: 1n,
|
|
1003
1003
|
privateKey: users[1].privateKey,
|
|
1004
1004
|
stateIndex: 1n,
|
|
@@ -1028,7 +1028,7 @@ describe("e2e tests", function test() {
|
|
|
1028
1028
|
pollId: 1n,
|
|
1029
1029
|
newVoteWeight: 7n,
|
|
1030
1030
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1031
|
-
salt: (0, crypto_1.
|
|
1031
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1032
1032
|
privateKey: users[0].privateKey.serialize(),
|
|
1033
1033
|
signer,
|
|
1034
1034
|
});
|
|
@@ -1042,7 +1042,7 @@ describe("e2e tests", function test() {
|
|
|
1042
1042
|
pollId: 1n,
|
|
1043
1043
|
newVoteWeight: 7n,
|
|
1044
1044
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1045
|
-
salt: (0, crypto_1.
|
|
1045
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1046
1046
|
privateKey: users[1].privateKey.serialize(),
|
|
1047
1047
|
signer,
|
|
1048
1048
|
});
|
|
@@ -1098,7 +1098,7 @@ describe("e2e tests", function test() {
|
|
|
1098
1098
|
relayers: [await signer.getAddress()],
|
|
1099
1099
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1100
1100
|
verifierContractAddress,
|
|
1101
|
-
|
|
1101
|
+
verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
|
|
1102
1102
|
policyContractAddress: pollPolicyContractAddress,
|
|
1103
1103
|
initialVoiceCreditProxyContractAddress,
|
|
1104
1104
|
});
|
|
@@ -1159,7 +1159,7 @@ describe("e2e tests", function test() {
|
|
|
1159
1159
|
pollId: 0n,
|
|
1160
1160
|
newVoteWeight: 9n,
|
|
1161
1161
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1162
|
-
salt: (0, crypto_1.
|
|
1162
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1163
1163
|
privateKey: users[0].privateKey.serialize(),
|
|
1164
1164
|
signer,
|
|
1165
1165
|
});
|
|
@@ -1167,7 +1167,7 @@ describe("e2e tests", function test() {
|
|
|
1167
1167
|
{
|
|
1168
1168
|
pollId: 0n,
|
|
1169
1169
|
voteOptionIndex: 0n,
|
|
1170
|
-
salt: (0, crypto_1.
|
|
1170
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1171
1171
|
nonce: 1n,
|
|
1172
1172
|
privateKey: users[0].privateKey,
|
|
1173
1173
|
stateIndex: 1n,
|
|
@@ -1216,7 +1216,7 @@ describe("e2e tests", function test() {
|
|
|
1216
1216
|
relayers: [await signer.getAddress()],
|
|
1217
1217
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1218
1218
|
verifierContractAddress,
|
|
1219
|
-
|
|
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
|
-
|
|
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
|
|
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
1249
|
privateKey: users[i].privateKey.serialize(),
|
|
1250
1250
|
stateIndex: BigInt(i + 1),
|
|
1251
|
-
pollId: BigInt(
|
|
1251
|
+
pollId: BigInt(pollId),
|
|
1252
1252
|
pollJoiningZkey: constants_1.pollJoiningTestZkeyPath,
|
|
1253
1253
|
useWasm: true,
|
|
1254
1254
|
pollWasm: constants_1.testPollJoiningWasmPath,
|
|
@@ -1261,7 +1261,7 @@ 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(
|
|
1264
|
+
pollId: BigInt(pollId),
|
|
1265
1265
|
pollPublicKey: users[i].publicKey.serialize(),
|
|
1266
1266
|
signer,
|
|
1267
1267
|
startBlock: 0,
|
|
@@ -1280,7 +1280,7 @@ describe("e2e tests", function test() {
|
|
|
1280
1280
|
pollId: 1n,
|
|
1281
1281
|
newVoteWeight: 9n,
|
|
1282
1282
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1283
|
-
salt: (0, crypto_1.
|
|
1283
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1284
1284
|
privateKey: users[0].privateKey.serialize(),
|
|
1285
1285
|
signer,
|
|
1286
1286
|
});
|
|
@@ -1292,7 +1292,7 @@ describe("e2e tests", function test() {
|
|
|
1292
1292
|
pollId: 1n,
|
|
1293
1293
|
newVoteWeight: 1n,
|
|
1294
1294
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1295
|
-
salt: (0, crypto_1.
|
|
1295
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1296
1296
|
privateKey: users[1].privateKey.serialize(),
|
|
1297
1297
|
signer,
|
|
1298
1298
|
});
|
|
@@ -1304,7 +1304,7 @@ describe("e2e tests", function test() {
|
|
|
1304
1304
|
pollId: 1n,
|
|
1305
1305
|
newVoteWeight: 3n,
|
|
1306
1306
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1307
|
-
salt: (0, crypto_1.
|
|
1307
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1308
1308
|
privateKey: users[2].privateKey.serialize(),
|
|
1309
1309
|
signer,
|
|
1310
1310
|
});
|
|
@@ -1314,7 +1314,7 @@ describe("e2e tests", function test() {
|
|
|
1314
1314
|
{
|
|
1315
1315
|
pollId: 1n,
|
|
1316
1316
|
voteOptionIndex: 0n,
|
|
1317
|
-
salt: (0, crypto_1.
|
|
1317
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1318
1318
|
nonce: 1n,
|
|
1319
1319
|
privateKey: users[0].privateKey,
|
|
1320
1320
|
stateIndex: 1n,
|
|
@@ -1340,7 +1340,7 @@ describe("e2e tests", function test() {
|
|
|
1340
1340
|
{
|
|
1341
1341
|
pollId: 2n,
|
|
1342
1342
|
voteOptionIndex: 7n,
|
|
1343
|
-
salt: (0, crypto_1.
|
|
1343
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1344
1344
|
nonce: 1n,
|
|
1345
1345
|
privateKey: users[4].privateKey,
|
|
1346
1346
|
stateIndex: 4n,
|
|
@@ -1352,7 +1352,7 @@ describe("e2e tests", function test() {
|
|
|
1352
1352
|
{
|
|
1353
1353
|
pollId: 2n,
|
|
1354
1354
|
voteOptionIndex: 5n,
|
|
1355
|
-
salt: (0, crypto_1.
|
|
1355
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1356
1356
|
nonce: 1n,
|
|
1357
1357
|
privateKey: users[5].privateKey,
|
|
1358
1358
|
stateIndex: 5n,
|
|
@@ -1382,7 +1382,7 @@ describe("e2e tests", function test() {
|
|
|
1382
1382
|
pollId: 2n,
|
|
1383
1383
|
newVoteWeight: 3n,
|
|
1384
1384
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1385
|
-
salt: (0, crypto_1.
|
|
1385
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1386
1386
|
privateKey: users[3].privateKey.serialize(),
|
|
1387
1387
|
signer,
|
|
1388
1388
|
});
|
|
@@ -1394,7 +1394,7 @@ describe("e2e tests", function test() {
|
|
|
1394
1394
|
pollId: 2n,
|
|
1395
1395
|
newVoteWeight: 2n,
|
|
1396
1396
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1397
|
-
salt: (0, crypto_1.
|
|
1397
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1398
1398
|
privateKey: users[4].privateKey.serialize(),
|
|
1399
1399
|
signer,
|
|
1400
1400
|
});
|
|
@@ -1406,7 +1406,7 @@ describe("e2e tests", function test() {
|
|
|
1406
1406
|
pollId: 2n,
|
|
1407
1407
|
newVoteWeight: 9n,
|
|
1408
1408
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1409
|
-
salt: (0, crypto_1.
|
|
1409
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1410
1410
|
privateKey: users[5].privateKey.serialize(),
|
|
1411
1411
|
signer,
|
|
1412
1412
|
});
|
|
@@ -1490,7 +1490,7 @@ describe("e2e tests", function test() {
|
|
|
1490
1490
|
relayers: [await signer.getAddress()],
|
|
1491
1491
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1492
1492
|
verifierContractAddress,
|
|
1493
|
-
|
|
1493
|
+
verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
|
|
1494
1494
|
policyContractAddress: pollPolicyContractAddress,
|
|
1495
1495
|
initialVoiceCreditProxyContractAddress,
|
|
1496
1496
|
});
|
|
@@ -1529,7 +1529,7 @@ describe("e2e tests", function test() {
|
|
|
1529
1529
|
pollId: 0n,
|
|
1530
1530
|
newVoteWeight: 3n,
|
|
1531
1531
|
maciAddress: maciAddresses.maciContractAddress,
|
|
1532
|
-
salt: (0, crypto_1.
|
|
1532
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1533
1533
|
privateKey: user.privateKey.serialize(),
|
|
1534
1534
|
signer,
|
|
1535
1535
|
});
|
|
@@ -1539,7 +1539,7 @@ describe("e2e tests", function test() {
|
|
|
1539
1539
|
{
|
|
1540
1540
|
pollId: 0n,
|
|
1541
1541
|
voteOptionIndex: 5n,
|
|
1542
|
-
salt: (0, crypto_1.
|
|
1542
|
+
salt: (0, crypto_1.generateRandomSalt)(),
|
|
1543
1543
|
nonce: 1n,
|
|
1544
1544
|
privateKey: user.privateKey,
|
|
1545
1545
|
stateIndex: 1n,
|