@maci-protocol/testing 0.0.0-ci.a577366 → 0.0.0-ci.a73cfa9

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 (53) 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 +422 -35
  7. package/build/ts/__tests__/e2e.nonQv.test.js.map +1 -1
  8. package/build/ts/__tests__/e2e.test.js +264 -274
  9. package/build/ts/__tests__/e2e.test.js.map +1 -1
  10. package/build/ts/__tests__/integration.test.js +60 -59
  11. package/build/ts/__tests__/integration.test.js.map +1 -1
  12. package/build/ts/__tests__/keyChange.test.js +74 -76
  13. package/build/ts/__tests__/keyChange.test.js.map +1 -1
  14. package/build/ts/__tests__/maciKeys.test.js +41 -41
  15. package/build/ts/__tests__/maciKeys.test.js.map +1 -1
  16. package/build/ts/__tests__/stress/stress.full.test.d.ts +2 -0
  17. package/build/ts/__tests__/stress/stress.full.test.d.ts.map +1 -0
  18. package/build/ts/__tests__/stress/stress.full.test.js +195 -0
  19. package/build/ts/__tests__/stress/stress.full.test.js.map +1 -0
  20. package/build/ts/__tests__/unit/joinPoll.test.js +65 -27
  21. package/build/ts/__tests__/unit/joinPoll.test.js.map +1 -1
  22. package/build/ts/__tests__/unit/poll.test.js +7 -6
  23. package/build/ts/__tests__/unit/poll.test.js.map +1 -1
  24. package/build/ts/__tests__/unit/publish.test.js +10 -9
  25. package/build/ts/__tests__/unit/publish.test.js.map +1 -1
  26. package/build/ts/__tests__/unit/setVerifyingKeys.test.d.ts +2 -0
  27. package/build/ts/__tests__/unit/setVerifyingKeys.test.d.ts.map +1 -0
  28. package/build/ts/__tests__/unit/setVerifyingKeys.test.js +52 -0
  29. package/build/ts/__tests__/unit/setVerifyingKeys.test.js.map +1 -0
  30. package/build/ts/__tests__/unit/signup.test.js +8 -8
  31. package/build/ts/__tests__/unit/signup.test.js.map +1 -1
  32. package/build/ts/__tests__/unit/utils.test.js +12 -12
  33. package/build/ts/__tests__/unit/utils.test.js.map +1 -1
  34. package/build/ts/constants.d.ts +53 -55
  35. package/build/ts/constants.d.ts.map +1 -1
  36. package/build/ts/constants.js +113 -74
  37. package/build/ts/constants.js.map +1 -1
  38. package/build/ts/testingClass.d.ts +7 -7
  39. package/build/ts/testingClass.d.ts.map +1 -1
  40. package/build/ts/testingClass.js +30 -26
  41. package/build/ts/testingClass.js.map +1 -1
  42. package/build/ts/types.d.ts +10 -11
  43. package/build/ts/types.d.ts.map +1 -1
  44. package/build/ts/user.d.ts +2 -2
  45. package/build/ts/user.d.ts.map +1 -1
  46. package/build/ts/user.js +1 -1
  47. package/build/ts/user.js.map +1 -1
  48. package/build/ts/utils.d.ts +3 -3
  49. package/build/ts/utils.d.ts.map +1 -1
  50. package/build/ts/utils.js +12 -12
  51. package/build/ts/utils.js.map +1 -1
  52. package/build/tsconfig.tsbuildinfo +1 -1
  53. package/package.json +19 -18
@@ -0,0 +1,845 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@maci-protocol/core");
4
+ const crypto_1 = require("@maci-protocol/crypto");
5
+ const domainobjs_1 = require("@maci-protocol/domainobjs");
6
+ const sdk_1 = require("@maci-protocol/sdk");
7
+ const chai_1 = require("chai");
8
+ const constants_1 = require("../constants");
9
+ const utils_1 = require("../utils");
10
+ /**
11
+ Test scenarios:
12
+ 1 signup, 1 message
13
+ 1 signup, 1 relayed message
14
+ 1 signup, 2 valid messages
15
+ 1 signup, 2 valid and 2 invalid messages
16
+ 4 signups, 8 messages, 16 relayed messages
17
+ 30 signups (31 ballots), 21 messages
18
+ 30 signups, 30 invalid and 1 valid messages
19
+ */
20
+ describe("e2e tests with full credits voting", function test() {
21
+ const useWasm = (0, sdk_1.isArm)();
22
+ this.timeout(900000);
23
+ let maciAddresses;
24
+ let initialVoiceCreditProxyContractAddress;
25
+ let verifierContractAddress;
26
+ let signer;
27
+ let verifyingKeysRegistryAddress;
28
+ const generateProofsArgs = {
29
+ outputDir: constants_1.testProofsDirPath,
30
+ tallyFile: constants_1.testTallyFilePath,
31
+ voteTallyZkey: constants_1.testTallyVotesFullZkeyPath,
32
+ messageProcessorZkey: constants_1.testProcessMessageFullZkeyPath,
33
+ pollId: 0n,
34
+ rapidsnark: constants_1.testRapidsnarkPath,
35
+ messageProcessorWitnessGenerator: constants_1.testProcessMessagesFullWitnessPath,
36
+ messageProcessorWitnessDatFile: constants_1.testProcessMessagesFullWitnessDatPath,
37
+ voteTallyWitnessGenerator: constants_1.testTallyVotesFullWitnessPath,
38
+ voteTallyWitnessDatFile: constants_1.testTallyVotesFullWitnessDatPath,
39
+ coordinatorPrivateKey: constants_1.coordinatorPrivateKey,
40
+ messageProcessorWasm: constants_1.testProcessMessagesFullWasmPath,
41
+ voteTallyWasm: constants_1.testTallyVotesFullWasmPath,
42
+ useWasm,
43
+ mode: sdk_1.EMode.FULL,
44
+ };
45
+ const prepareTest = async () => {
46
+ const [signupPolicy, , signupPolicyFactory, signupCheckerFactory] = await (0, sdk_1.deployFreeForAllSignUpPolicy)({}, signer, true);
47
+ const signupPolicyContractAddress = await signupPolicy.getAddress();
48
+ const [pollPolicy] = await (0, sdk_1.deployFreeForAllSignUpPolicy)({ policy: signupPolicyFactory, checker: signupCheckerFactory }, signer, true);
49
+ const pollPolicyContractAddress = await pollPolicy.getAddress();
50
+ // deploy the smart contracts
51
+ const maciContractsAddresses = await (0, sdk_1.deployMaci)({
52
+ ...constants_1.deployArgs,
53
+ signer,
54
+ signupPolicyAddress: signupPolicyContractAddress,
55
+ });
56
+ const startDate = await (0, sdk_1.getBlockTimestamp)(signer);
57
+ // deploy a poll contract
58
+ await (0, sdk_1.deployPoll)({
59
+ ...constants_1.deployPollArgs,
60
+ signer,
61
+ pollStartTimestamp: startDate,
62
+ pollEndTimestamp: startDate + constants_1.pollDuration,
63
+ relayers: [await signer.getAddress()],
64
+ maciAddress: maciContractsAddresses.maciContractAddress,
65
+ verifierContractAddress,
66
+ verifyingKeysRegistryContractAddress: verifyingKeysRegistryAddress,
67
+ policyContractAddress: pollPolicyContractAddress,
68
+ initialVoiceCreditProxyContractAddress,
69
+ mode: sdk_1.EMode.FULL,
70
+ });
71
+ return maciContractsAddresses;
72
+ };
73
+ // before all tests we deploy the verifying keys registry contract and set the verifying keys
74
+ before(async () => {
75
+ signer = await (0, sdk_1.getDefaultSigner)();
76
+ // we deploy the verifying keys registry contract
77
+ verifyingKeysRegistryAddress = await (0, sdk_1.deployVerifyingKeysRegistryContract)({ signer });
78
+ const constantInitialVoiceCreditProxyFactory = await (0, sdk_1.deployConstantInitialVoiceCreditProxyFactory)(signer, true);
79
+ const initialVoiceCreditProxy = await (0, sdk_1.deployConstantInitialVoiceCreditProxy)({ amount: constants_1.DEFAULT_INITIAL_VOICE_CREDITS }, constantInitialVoiceCreditProxyFactory, signer);
80
+ initialVoiceCreditProxyContractAddress = await initialVoiceCreditProxy.getAddress();
81
+ const verifier = await (0, sdk_1.deployVerifier)(signer, true);
82
+ verifierContractAddress = await verifier.getAddress();
83
+ // we deploy the verifying keys registry contract
84
+ verifyingKeysRegistryAddress = await (0, sdk_1.deployVerifyingKeysRegistryContract)({ signer });
85
+ // we set the verifying keys
86
+ await (0, sdk_1.setVerifyingKeys)({ ...(await (0, constants_1.verifyingKeysArgs)(signer, [sdk_1.EMode.FULL])), verifyingKeysRegistryAddress });
87
+ });
88
+ describe("1 signup, 1 message", () => {
89
+ after(async () => {
90
+ await (0, utils_1.clean)();
91
+ });
92
+ const user = new domainobjs_1.Keypair();
93
+ before(async () => {
94
+ // deploy the smart contracts
95
+ maciAddresses = await prepareTest();
96
+ });
97
+ it("should signup one user", async () => {
98
+ await (0, sdk_1.signup)({
99
+ maciAddress: maciAddresses.maciContractAddress,
100
+ maciPublicKey: user.publicKey.serialize(),
101
+ sgData: constants_1.DEFAULT_SG_DATA,
102
+ signer,
103
+ });
104
+ });
105
+ it("should join one user", async () => {
106
+ await (0, sdk_1.joinPoll)({
107
+ maciAddress: maciAddresses.maciContractAddress,
108
+ privateKey: user.privateKey.serialize(),
109
+ pollId: 0n,
110
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
111
+ useWasm,
112
+ pollWasm: constants_1.testPollJoiningWasmPath,
113
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
114
+ rapidsnark: constants_1.testRapidsnarkPath,
115
+ sgDataArg: constants_1.DEFAULT_SG_DATA,
116
+ ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
117
+ signer,
118
+ });
119
+ });
120
+ it("should publish one message", async () => {
121
+ await (0, sdk_1.publish)({
122
+ publicKey: user.publicKey.serialize(),
123
+ stateIndex: 1n,
124
+ voteOptionIndex: 0n,
125
+ nonce: 1n,
126
+ pollId: 0n,
127
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
128
+ maciAddress: maciAddresses.maciContractAddress,
129
+ salt: (0, crypto_1.generateRandomSalt)(),
130
+ privateKey: user.privateKey.serialize(),
131
+ signer,
132
+ });
133
+ });
134
+ it("should generate zk-SNARK proofs and verify them", async () => {
135
+ await (0, sdk_1.timeTravel)({ seconds: constants_1.pollDuration, signer });
136
+ await (0, sdk_1.mergeSignups)({ ...constants_1.mergeSignupsArgs, maciAddress: maciAddresses.maciContractAddress, signer });
137
+ const { tallyData: tallyFileData } = await (0, sdk_1.generateProofs)({
138
+ ...generateProofsArgs,
139
+ signer,
140
+ maciAddress: maciAddresses.maciContractAddress,
141
+ mode: sdk_1.EMode.FULL,
142
+ });
143
+ await (0, sdk_1.proveOnChain)({ ...constants_1.proveOnChainArgs, maciAddress: maciAddresses.maciContractAddress, signer });
144
+ await (0, sdk_1.verify)({
145
+ ...(await (0, constants_1.verifyArgs)(signer)),
146
+ tallyData: tallyFileData,
147
+ maciAddress: tallyFileData.maci,
148
+ });
149
+ (0, chai_1.expect)(tallyFileData.totalSpentVoiceCredits.spent.toString()).to.eq(constants_1.DEFAULT_INITIAL_VOICE_CREDITS.toString());
150
+ tallyFileData.results.tally.forEach((result, index) => {
151
+ (0, chai_1.expect)(result.toString()).to.eq(index === 0 ? constants_1.DEFAULT_INITIAL_VOICE_CREDITS.toString() : "0");
152
+ });
153
+ });
154
+ });
155
+ describe("1 signup, 1 relayed message", () => {
156
+ after(async () => {
157
+ await (0, utils_1.clean)();
158
+ });
159
+ const user = new domainobjs_1.Keypair();
160
+ before(async () => {
161
+ // deploy the smart contracts
162
+ maciAddresses = await prepareTest();
163
+ });
164
+ it("should signup one user", async () => {
165
+ await (0, sdk_1.signup)({
166
+ maciAddress: maciAddresses.maciContractAddress,
167
+ maciPublicKey: user.publicKey.serialize(),
168
+ sgData: constants_1.DEFAULT_SG_DATA,
169
+ signer,
170
+ });
171
+ });
172
+ it("should join one user", async () => {
173
+ await (0, sdk_1.joinPoll)({
174
+ maciAddress: maciAddresses.maciContractAddress,
175
+ privateKey: user.privateKey.serialize(),
176
+ pollId: 0n,
177
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
178
+ useWasm,
179
+ pollWasm: constants_1.testPollJoiningWasmPath,
180
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
181
+ rapidsnark: constants_1.testRapidsnarkPath,
182
+ sgDataArg: constants_1.DEFAULT_SG_DATA,
183
+ ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
184
+ signer,
185
+ });
186
+ });
187
+ it("should relay one message", async () => {
188
+ const { message, ephemeralKeypair } = (0, sdk_1.generateVote)({
189
+ pollId: 0n,
190
+ voteOptionIndex: 0n,
191
+ salt: (0, crypto_1.generateRandomSalt)(),
192
+ nonce: 1n,
193
+ privateKey: user.privateKey,
194
+ stateIndex: 1n,
195
+ voteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
196
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
197
+ maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
198
+ newPublicKey: user.publicKey,
199
+ });
200
+ const messages = [
201
+ {
202
+ maciAddress: maciAddresses.maciContractAddress,
203
+ poll: 0,
204
+ data: message.data.map(String),
205
+ publicKey: ephemeralKeypair.publicKey.asArray().map(String),
206
+ hash: message.hash(ephemeralKeypair.publicKey).toString(),
207
+ },
208
+ ];
209
+ await (0, utils_1.relayTestMessages)({ messages, signer, pollId: 0, maciAddress: maciAddresses.maciContractAddress });
210
+ });
211
+ it("should generate zk-SNARK proofs and verify them", async () => {
212
+ const ipfsMessageBackupFiles = await (0, utils_1.getBackupFilenames)();
213
+ await (0, sdk_1.timeTravel)({ seconds: constants_1.pollDuration, signer });
214
+ await (0, sdk_1.mergeSignups)({ ...constants_1.mergeSignupsArgs, maciAddress: maciAddresses.maciContractAddress, signer });
215
+ const { tallyData: tallyFileData } = await (0, sdk_1.generateProofs)({
216
+ ...generateProofsArgs,
217
+ signer,
218
+ maciAddress: maciAddresses.maciContractAddress,
219
+ ipfsMessageBackupFiles,
220
+ mode: sdk_1.EMode.FULL,
221
+ });
222
+ await (0, sdk_1.proveOnChain)({ ...constants_1.proveOnChainArgs, maciAddress: maciAddresses.maciContractAddress, signer });
223
+ await (0, sdk_1.verify)({
224
+ ...(await (0, constants_1.verifyArgs)(signer)),
225
+ tallyData: tallyFileData,
226
+ maciAddress: tallyFileData.maci,
227
+ });
228
+ (0, chai_1.expect)(tallyFileData.totalSpentVoiceCredits.spent.toString()).to.eq(constants_1.DEFAULT_INITIAL_VOICE_CREDITS.toString());
229
+ tallyFileData.results.tally.forEach((result, index) => {
230
+ (0, chai_1.expect)(result.toString()).to.eq(index === 0 ? constants_1.DEFAULT_INITIAL_VOICE_CREDITS.toString() : "0");
231
+ });
232
+ });
233
+ });
234
+ describe("1 signup, 2 valid messages", () => {
235
+ after(async () => {
236
+ await (0, utils_1.clean)();
237
+ });
238
+ const user = new domainobjs_1.Keypair();
239
+ before(async () => {
240
+ // deploy the smart contracts
241
+ maciAddresses = await prepareTest();
242
+ });
243
+ it("should signup one user", async () => {
244
+ await (0, sdk_1.signup)({
245
+ maciAddress: maciAddresses.maciContractAddress,
246
+ maciPublicKey: user.publicKey.serialize(),
247
+ sgData: constants_1.DEFAULT_SG_DATA,
248
+ signer,
249
+ });
250
+ });
251
+ it("should join one user", async () => {
252
+ await (0, sdk_1.joinPoll)({
253
+ maciAddress: maciAddresses.maciContractAddress,
254
+ privateKey: user.privateKey.serialize(),
255
+ pollId: 0n,
256
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
257
+ useWasm,
258
+ pollWasm: constants_1.testPollJoiningWasmPath,
259
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
260
+ rapidsnark: constants_1.testRapidsnarkPath,
261
+ sgDataArg: constants_1.DEFAULT_SG_DATA,
262
+ ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
263
+ signer,
264
+ });
265
+ });
266
+ it("should publish two messages", async () => {
267
+ await (0, sdk_1.publish)({
268
+ publicKey: user.publicKey.serialize(),
269
+ stateIndex: 1n,
270
+ voteOptionIndex: 0n,
271
+ nonce: 1n,
272
+ pollId: 0n,
273
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
274
+ maciAddress: maciAddresses.maciContractAddress,
275
+ salt: (0, crypto_1.generateRandomSalt)(),
276
+ privateKey: user.privateKey.serialize(),
277
+ signer,
278
+ });
279
+ await (0, sdk_1.publish)({
280
+ publicKey: user.publicKey.serialize(),
281
+ stateIndex: 1n,
282
+ voteOptionIndex: 1n,
283
+ nonce: 1n,
284
+ pollId: 0n,
285
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
286
+ maciAddress: maciAddresses.maciContractAddress,
287
+ salt: (0, crypto_1.generateRandomSalt)(),
288
+ privateKey: user.privateKey.serialize(),
289
+ signer,
290
+ });
291
+ });
292
+ it("should generate zk-SNARK proofs and verify them", async () => {
293
+ await (0, sdk_1.timeTravel)({ seconds: constants_1.pollDuration, signer });
294
+ await (0, sdk_1.mergeSignups)({ ...constants_1.mergeSignupsArgs, maciAddress: maciAddresses.maciContractAddress, signer });
295
+ const { tallyData: tallyFileData } = await (0, sdk_1.generateProofs)({
296
+ ...generateProofsArgs,
297
+ signer,
298
+ maciAddress: maciAddresses.maciContractAddress,
299
+ mode: sdk_1.EMode.FULL,
300
+ });
301
+ await (0, sdk_1.proveOnChain)({ ...constants_1.proveOnChainArgs, maciAddress: maciAddresses.maciContractAddress, signer });
302
+ await (0, sdk_1.verify)({
303
+ ...(await (0, constants_1.verifyArgs)(signer)),
304
+ tallyData: tallyFileData,
305
+ maciAddress: tallyFileData.maci,
306
+ });
307
+ (0, chai_1.expect)(tallyFileData.totalSpentVoiceCredits.spent.toString()).to.eq(constants_1.DEFAULT_INITIAL_VOICE_CREDITS.toString());
308
+ tallyFileData.results.tally.forEach((result, index) => {
309
+ (0, chai_1.expect)(result.toString()).to.eq(index === 1 ? constants_1.DEFAULT_INITIAL_VOICE_CREDITS.toString() : "0");
310
+ });
311
+ });
312
+ });
313
+ describe("1 signup, 2 valid and 2 invalid message", () => {
314
+ after(async () => {
315
+ await (0, utils_1.clean)();
316
+ });
317
+ const user = new domainobjs_1.Keypair();
318
+ before(async () => {
319
+ // deploy the smart contracts
320
+ maciAddresses = await prepareTest();
321
+ });
322
+ it("should signup one user", async () => {
323
+ await (0, sdk_1.signup)({
324
+ maciAddress: maciAddresses.maciContractAddress,
325
+ maciPublicKey: user.publicKey.serialize(),
326
+ sgData: constants_1.DEFAULT_SG_DATA,
327
+ signer,
328
+ });
329
+ });
330
+ it("should join one user", async () => {
331
+ await (0, sdk_1.joinPoll)({
332
+ maciAddress: maciAddresses.maciContractAddress,
333
+ privateKey: user.privateKey.serialize(),
334
+ pollId: 0n,
335
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
336
+ useWasm,
337
+ pollWasm: constants_1.testPollJoiningWasmPath,
338
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
339
+ rapidsnark: constants_1.testRapidsnarkPath,
340
+ sgDataArg: constants_1.DEFAULT_SG_DATA,
341
+ ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
342
+ signer,
343
+ });
344
+ });
345
+ it("should publish two valid and two invalid messages", async () => {
346
+ await (0, sdk_1.publish)({
347
+ publicKey: user.publicKey.serialize(),
348
+ stateIndex: 1n,
349
+ voteOptionIndex: 0n,
350
+ nonce: 1n,
351
+ pollId: 0n,
352
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
353
+ maciAddress: maciAddresses.maciContractAddress,
354
+ salt: (0, crypto_1.generateRandomSalt)(),
355
+ privateKey: user.privateKey.serialize(),
356
+ signer,
357
+ });
358
+ await (0, sdk_1.publish)({
359
+ publicKey: user.publicKey.serialize(),
360
+ stateIndex: 1n,
361
+ voteOptionIndex: 1n,
362
+ nonce: 1n,
363
+ pollId: 0n,
364
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
365
+ maciAddress: maciAddresses.maciContractAddress,
366
+ salt: (0, crypto_1.generateRandomSalt)(),
367
+ privateKey: user.privateKey.serialize(),
368
+ signer,
369
+ });
370
+ await (0, sdk_1.publish)({
371
+ publicKey: user.publicKey.serialize(),
372
+ stateIndex: 1n,
373
+ voteOptionIndex: 1n,
374
+ nonce: 1n,
375
+ pollId: 0n,
376
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS - 10),
377
+ maciAddress: maciAddresses.maciContractAddress,
378
+ salt: (0, crypto_1.generateRandomSalt)(),
379
+ privateKey: user.privateKey.serialize(),
380
+ signer,
381
+ });
382
+ await (0, sdk_1.publish)({
383
+ publicKey: user.publicKey.serialize(),
384
+ stateIndex: 1n,
385
+ voteOptionIndex: 1n,
386
+ nonce: 1n,
387
+ pollId: 0n,
388
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS + 10),
389
+ maciAddress: maciAddresses.maciContractAddress,
390
+ salt: (0, crypto_1.generateRandomSalt)(),
391
+ privateKey: user.privateKey.serialize(),
392
+ signer,
393
+ });
394
+ });
395
+ it("should generate zk-SNARK proofs and verify them", async () => {
396
+ await (0, sdk_1.timeTravel)({ seconds: constants_1.pollDuration, signer });
397
+ await (0, sdk_1.mergeSignups)({ ...constants_1.mergeSignupsArgs, maciAddress: maciAddresses.maciContractAddress, signer });
398
+ const { tallyData: tallyFileData } = await (0, sdk_1.generateProofs)({
399
+ ...generateProofsArgs,
400
+ signer,
401
+ maciAddress: maciAddresses.maciContractAddress,
402
+ mode: sdk_1.EMode.FULL,
403
+ });
404
+ await (0, sdk_1.proveOnChain)({ ...constants_1.proveOnChainArgs, maciAddress: maciAddresses.maciContractAddress, signer });
405
+ await (0, sdk_1.verify)({
406
+ ...(await (0, constants_1.verifyArgs)(signer)),
407
+ tallyData: tallyFileData,
408
+ maciAddress: tallyFileData.maci,
409
+ });
410
+ (0, chai_1.expect)(tallyFileData.totalSpentVoiceCredits.spent.toString()).to.eq(constants_1.DEFAULT_INITIAL_VOICE_CREDITS.toString());
411
+ tallyFileData.results.tally.forEach((result, index) => {
412
+ (0, chai_1.expect)(result.toString()).to.eq(index === 1 ? constants_1.DEFAULT_INITIAL_VOICE_CREDITS.toString() : "0");
413
+ });
414
+ });
415
+ });
416
+ describe("4 signups, 8 messages, 16 relayed messages", () => {
417
+ after(async () => {
418
+ await (0, utils_1.clean)();
419
+ });
420
+ const users = [new domainobjs_1.Keypair(), new domainobjs_1.Keypair(), new domainobjs_1.Keypair(), new domainobjs_1.Keypair()];
421
+ before(async () => {
422
+ // deploy the smart contracts
423
+ maciAddresses = await prepareTest();
424
+ });
425
+ it("should signup four users", async () => {
426
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
427
+ for (let i = 0; i < users.length; i += 1) {
428
+ // eslint-disable-next-line no-await-in-loop
429
+ await (0, sdk_1.signup)({
430
+ maciAddress: maciAddresses.maciContractAddress,
431
+ maciPublicKey: users[i].publicKey.serialize(),
432
+ sgData: constants_1.DEFAULT_SG_DATA,
433
+ signer,
434
+ });
435
+ }
436
+ });
437
+ it("should join four users", async () => {
438
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
439
+ for (let i = 0; i < users.length; i += 1) {
440
+ // eslint-disable-next-line no-await-in-loop
441
+ await (0, sdk_1.joinPoll)({
442
+ maciAddress: maciAddresses.maciContractAddress,
443
+ privateKey: users[i].privateKey.serialize(),
444
+ pollId: 0n,
445
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
446
+ useWasm,
447
+ pollWasm: constants_1.testPollJoiningWasmPath,
448
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
449
+ rapidsnark: constants_1.testRapidsnarkPath,
450
+ sgDataArg: constants_1.DEFAULT_SG_DATA,
451
+ ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
452
+ signer,
453
+ });
454
+ }
455
+ });
456
+ it("should publish eight messages", async () => {
457
+ await (0, sdk_1.publish)({
458
+ publicKey: users[0].publicKey.serialize(),
459
+ stateIndex: 1n,
460
+ voteOptionIndex: 0n,
461
+ nonce: 2n,
462
+ pollId: 0n,
463
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
464
+ maciAddress: maciAddresses.maciContractAddress,
465
+ salt: (0, crypto_1.generateRandomSalt)(),
466
+ privateKey: users[0].privateKey.serialize(),
467
+ signer,
468
+ });
469
+ await (0, sdk_1.publish)({
470
+ publicKey: users[0].publicKey.serialize(),
471
+ stateIndex: 1n,
472
+ voteOptionIndex: 0n,
473
+ nonce: 2n,
474
+ pollId: 0n,
475
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
476
+ maciAddress: maciAddresses.maciContractAddress,
477
+ salt: (0, crypto_1.generateRandomSalt)(),
478
+ privateKey: users[0].privateKey.serialize(),
479
+ signer,
480
+ });
481
+ await (0, sdk_1.publish)({
482
+ publicKey: users[0].publicKey.serialize(),
483
+ stateIndex: 1n,
484
+ voteOptionIndex: 0n,
485
+ nonce: 1n,
486
+ pollId: 0n,
487
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
488
+ maciAddress: maciAddresses.maciContractAddress,
489
+ salt: (0, crypto_1.generateRandomSalt)(),
490
+ privateKey: users[0].privateKey.serialize(),
491
+ signer,
492
+ });
493
+ await (0, sdk_1.publish)({
494
+ publicKey: users[1].publicKey.serialize(),
495
+ stateIndex: 2n,
496
+ voteOptionIndex: 2n,
497
+ nonce: 1n,
498
+ pollId: 0n,
499
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
500
+ maciAddress: maciAddresses.maciContractAddress,
501
+ salt: (0, crypto_1.generateRandomSalt)(),
502
+ privateKey: users[1].privateKey.serialize(),
503
+ signer,
504
+ });
505
+ await (0, sdk_1.publish)({
506
+ publicKey: users[2].publicKey.serialize(),
507
+ stateIndex: 3n,
508
+ voteOptionIndex: 2n,
509
+ nonce: 1n,
510
+ pollId: 0n,
511
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
512
+ maciAddress: maciAddresses.maciContractAddress,
513
+ salt: (0, crypto_1.generateRandomSalt)(),
514
+ privateKey: users[2].privateKey.serialize(),
515
+ signer,
516
+ });
517
+ await (0, sdk_1.publish)({
518
+ publicKey: users[3].publicKey.serialize(),
519
+ stateIndex: 4n,
520
+ voteOptionIndex: 2n,
521
+ nonce: 3n,
522
+ pollId: 0n,
523
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
524
+ maciAddress: maciAddresses.maciContractAddress,
525
+ salt: (0, crypto_1.generateRandomSalt)(),
526
+ privateKey: users[3].privateKey.serialize(),
527
+ signer,
528
+ });
529
+ await (0, sdk_1.publish)({
530
+ publicKey: users[3].publicKey.serialize(),
531
+ stateIndex: 4n,
532
+ voteOptionIndex: 2n,
533
+ nonce: 2n,
534
+ pollId: 0n,
535
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
536
+ maciAddress: maciAddresses.maciContractAddress,
537
+ salt: (0, crypto_1.generateRandomSalt)(),
538
+ privateKey: users[3].privateKey.serialize(),
539
+ signer,
540
+ });
541
+ await (0, sdk_1.publish)({
542
+ publicKey: users[3].publicKey.serialize(),
543
+ stateIndex: 4n,
544
+ voteOptionIndex: 1n,
545
+ nonce: 1n,
546
+ pollId: 0n,
547
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
548
+ maciAddress: maciAddresses.maciContractAddress,
549
+ salt: (0, crypto_1.generateRandomSalt)(),
550
+ privateKey: users[3].privateKey.serialize(),
551
+ signer,
552
+ });
553
+ });
554
+ it("should relay sixteen messages", async () => {
555
+ const votes = [
556
+ {
557
+ pollId: 0n,
558
+ voteOptionIndex: 1n,
559
+ salt: (0, crypto_1.generateRandomSalt)(),
560
+ nonce: 2n,
561
+ privateKey: users[0].privateKey,
562
+ stateIndex: 1n,
563
+ voteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
564
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
565
+ maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
566
+ newPublicKey: users[0].publicKey,
567
+ },
568
+ {
569
+ pollId: 0n,
570
+ voteOptionIndex: 1n,
571
+ salt: (0, crypto_1.generateRandomSalt)(),
572
+ nonce: 2n,
573
+ privateKey: users[0].privateKey,
574
+ stateIndex: 1n,
575
+ voteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
576
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
577
+ maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
578
+ newPublicKey: users[0].publicKey,
579
+ },
580
+ {
581
+ pollId: 0n,
582
+ voteOptionIndex: 1n,
583
+ salt: (0, crypto_1.generateRandomSalt)(),
584
+ nonce: 1n,
585
+ privateKey: users[0].privateKey,
586
+ stateIndex: 1n,
587
+ voteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
588
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
589
+ maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
590
+ newPublicKey: users[0].publicKey,
591
+ },
592
+ {
593
+ pollId: 0n,
594
+ voteOptionIndex: 1n,
595
+ salt: (0, crypto_1.generateRandomSalt)(),
596
+ nonce: 1n,
597
+ privateKey: users[1].privateKey,
598
+ stateIndex: 2n,
599
+ voteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
600
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
601
+ maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
602
+ newPublicKey: users[1].publicKey,
603
+ },
604
+ {
605
+ pollId: 0n,
606
+ voteOptionIndex: 1n,
607
+ salt: (0, crypto_1.generateRandomSalt)(),
608
+ nonce: 1n,
609
+ privateKey: users[2].privateKey,
610
+ stateIndex: 3n,
611
+ voteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
612
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
613
+ maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
614
+ newPublicKey: users[2].publicKey,
615
+ },
616
+ {
617
+ pollId: 0n,
618
+ voteOptionIndex: 0n,
619
+ salt: (0, crypto_1.generateRandomSalt)(),
620
+ nonce: 3n,
621
+ privateKey: users[3].privateKey,
622
+ stateIndex: 4n,
623
+ voteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
624
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
625
+ maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
626
+ newPublicKey: users[3].publicKey,
627
+ },
628
+ {
629
+ pollId: 0n,
630
+ voteOptionIndex: 0n,
631
+ salt: (0, crypto_1.generateRandomSalt)(),
632
+ nonce: 2n,
633
+ privateKey: users[3].privateKey,
634
+ stateIndex: 4n,
635
+ voteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
636
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
637
+ maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
638
+ newPublicKey: users[3].publicKey,
639
+ },
640
+ {
641
+ pollId: 0n,
642
+ voteOptionIndex: 0n,
643
+ salt: (0, crypto_1.generateRandomSalt)(),
644
+ nonce: 1n,
645
+ privateKey: users[3].privateKey,
646
+ stateIndex: 4n,
647
+ voteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
648
+ coordinatorPublicKey: constants_1.coordinatorKeypair.publicKey,
649
+ maxVoteOption: BigInt(core_1.VOTE_OPTION_TREE_ARITY ** constants_1.deployPollArgs.voteOptionTreeDepth),
650
+ newPublicKey: users[3].publicKey,
651
+ },
652
+ ];
653
+ const messages = votes
654
+ .map((vote) => (0, sdk_1.generateVote)(vote))
655
+ .map(({ message, ephemeralKeypair }) => ({
656
+ maciAddress: maciAddresses.maciContractAddress,
657
+ poll: 0,
658
+ data: message.data.map(String),
659
+ publicKey: ephemeralKeypair.publicKey.asArray().map(String),
660
+ hash: message.hash(ephemeralKeypair.publicKey).toString(),
661
+ }));
662
+ await (0, utils_1.relayTestMessages)({ messages, signer, pollId: 0, maciAddress: maciAddresses.maciContractAddress });
663
+ });
664
+ it("should generate zk-SNARK proofs and verify them", async () => {
665
+ const ipfsMessageBackupFiles = await (0, utils_1.getBackupFilenames)();
666
+ await (0, sdk_1.timeTravel)({ seconds: constants_1.pollDuration, signer });
667
+ await (0, sdk_1.mergeSignups)({ ...constants_1.mergeSignupsArgs, maciAddress: maciAddresses.maciContractAddress, signer });
668
+ const { tallyData: tallyFileData } = await (0, sdk_1.generateProofs)({
669
+ ...generateProofsArgs,
670
+ signer,
671
+ maciAddress: maciAddresses.maciContractAddress,
672
+ ipfsMessageBackupFiles,
673
+ });
674
+ await (0, sdk_1.proveOnChain)({ ...constants_1.proveOnChainArgs, maciAddress: maciAddresses.maciContractAddress, signer });
675
+ await (0, sdk_1.verify)({ ...(await (0, constants_1.verifyArgs)(signer)) });
676
+ (0, chai_1.expect)(tallyFileData.totalSpentVoiceCredits.spent.toString()).to.eq((constants_1.DEFAULT_INITIAL_VOICE_CREDITS * users.length).toString());
677
+ (0, chai_1.expect)(tallyFileData.results.tally[0].toString()).to.eq("100");
678
+ (0, chai_1.expect)(tallyFileData.results.tally[1].toString()).to.eq("300");
679
+ tallyFileData.results.tally.forEach((result, index) => {
680
+ if (index > 1) {
681
+ (0, chai_1.expect)(result).to.eq("0");
682
+ }
683
+ });
684
+ });
685
+ });
686
+ describe("30 signups (31 ballots), 30 messages", () => {
687
+ after(async () => {
688
+ await (0, utils_1.clean)();
689
+ });
690
+ const users = Array.from({ length: 30 }, () => new domainobjs_1.Keypair());
691
+ before(async () => {
692
+ // deploy the smart contracts
693
+ maciAddresses = await prepareTest();
694
+ });
695
+ it("should signup thirty users", async () => {
696
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
697
+ for (let i = 0; i < users.length; i += 1) {
698
+ // eslint-disable-next-line no-await-in-loop
699
+ await (0, sdk_1.signup)({
700
+ maciAddress: maciAddresses.maciContractAddress,
701
+ maciPublicKey: users[i].publicKey.serialize(),
702
+ sgData: constants_1.DEFAULT_SG_DATA,
703
+ signer,
704
+ });
705
+ }
706
+ });
707
+ it("should join thirty users", async () => {
708
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
709
+ for (let i = 0; i < users.length; i += 1) {
710
+ // eslint-disable-next-line no-await-in-loop
711
+ await (0, sdk_1.joinPoll)({
712
+ maciAddress: maciAddresses.maciContractAddress,
713
+ privateKey: users[i].privateKey.serialize(),
714
+ pollId: 0n,
715
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
716
+ useWasm,
717
+ pollWasm: constants_1.testPollJoiningWasmPath,
718
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
719
+ rapidsnark: constants_1.testRapidsnarkPath,
720
+ sgDataArg: constants_1.DEFAULT_SG_DATA,
721
+ ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
722
+ signer,
723
+ });
724
+ }
725
+ });
726
+ it("should publish 30 messages", async () => {
727
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
728
+ for (let i = 0; i < users.length; i += 1) {
729
+ // eslint-disable-next-line no-await-in-loop
730
+ await (0, sdk_1.publish)({
731
+ maciAddress: maciAddresses.maciContractAddress,
732
+ publicKey: users[i].publicKey.serialize(),
733
+ stateIndex: BigInt(i + 1),
734
+ voteOptionIndex: 0n,
735
+ nonce: 1n,
736
+ pollId: 0n,
737
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
738
+ salt: (0, crypto_1.generateRandomSalt)(),
739
+ privateKey: users[i].privateKey.serialize(),
740
+ signer,
741
+ });
742
+ }
743
+ });
744
+ it("should generate zk-SNARK proofs and verify them", async () => {
745
+ await (0, sdk_1.timeTravel)({ seconds: constants_1.pollDuration, signer });
746
+ await (0, sdk_1.mergeSignups)({ ...constants_1.mergeSignupsArgs, maciAddress: maciAddresses.maciContractAddress, signer });
747
+ const { tallyData: tallyFileData } = await (0, sdk_1.generateProofs)({
748
+ ...generateProofsArgs,
749
+ maciAddress: maciAddresses.maciContractAddress,
750
+ signer,
751
+ });
752
+ await (0, sdk_1.proveOnChain)({ ...constants_1.proveOnChainArgs, maciAddress: maciAddresses.maciContractAddress, signer });
753
+ await (0, sdk_1.verify)({ ...(await (0, constants_1.verifyArgs)(signer)), tallyData: tallyFileData });
754
+ const totalSpent = (constants_1.DEFAULT_INITIAL_VOICE_CREDITS * users.length).toString();
755
+ (0, chai_1.expect)(tallyFileData.totalSpentVoiceCredits.spent.toString()).to.eq(totalSpent);
756
+ (0, chai_1.expect)(tallyFileData.results.tally[0].toString()).to.eq(totalSpent);
757
+ });
758
+ });
759
+ describe("30 signups, 20 invalid and 1 valid messages", () => {
760
+ after(async () => {
761
+ await (0, utils_1.clean)();
762
+ });
763
+ const users = Array.from({ length: 30 }, () => new domainobjs_1.Keypair());
764
+ before(async () => {
765
+ // deploy the smart contracts
766
+ maciAddresses = await prepareTest();
767
+ });
768
+ it("should signup thirty users", async () => {
769
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
770
+ for (let i = 0; i < users.length; i += 1) {
771
+ // eslint-disable-next-line no-await-in-loop
772
+ await (0, sdk_1.signup)({
773
+ maciAddress: maciAddresses.maciContractAddress,
774
+ maciPublicKey: users[i].publicKey.serialize(),
775
+ sgData: constants_1.DEFAULT_SG_DATA,
776
+ signer,
777
+ });
778
+ }
779
+ });
780
+ it("should join thirty users", async () => {
781
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
782
+ for (let i = 0; i < users.length; i += 1) {
783
+ // eslint-disable-next-line no-await-in-loop
784
+ await (0, sdk_1.joinPoll)({
785
+ maciAddress: maciAddresses.maciContractAddress,
786
+ privateKey: users[i].privateKey.serialize(),
787
+ pollId: 0n,
788
+ pollJoiningZkey: constants_1.testPollJoiningZkeyPath,
789
+ useWasm,
790
+ pollWasm: constants_1.testPollJoiningWasmPath,
791
+ pollWitnessGenerator: constants_1.testPollJoiningWitnessPath,
792
+ rapidsnark: constants_1.testRapidsnarkPath,
793
+ sgDataArg: constants_1.DEFAULT_SG_DATA,
794
+ ivcpDataArg: constants_1.DEFAULT_IVCP_DATA,
795
+ signer,
796
+ });
797
+ }
798
+ });
799
+ it("should publish 30 invalid and 1 valid messages", async () => {
800
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
801
+ for (let i = 0; i < users.length; i += 1) {
802
+ // eslint-disable-next-line no-await-in-loop
803
+ await (0, sdk_1.publish)({
804
+ maciAddress: maciAddresses.maciContractAddress,
805
+ publicKey: users[i].publicKey.serialize(),
806
+ stateIndex: BigInt(i + 1),
807
+ voteOptionIndex: 0n,
808
+ nonce: 1n,
809
+ pollId: 0n,
810
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS + 10),
811
+ salt: (0, crypto_1.generateRandomSalt)(),
812
+ privateKey: users[i].privateKey.serialize(),
813
+ signer,
814
+ });
815
+ }
816
+ await (0, sdk_1.publish)({
817
+ maciAddress: maciAddresses.maciContractAddress,
818
+ publicKey: users[0].publicKey.serialize(),
819
+ stateIndex: 1n,
820
+ voteOptionIndex: 0n,
821
+ nonce: 1n,
822
+ pollId: 0n,
823
+ newVoteWeight: BigInt(constants_1.DEFAULT_INITIAL_VOICE_CREDITS),
824
+ salt: (0, crypto_1.generateRandomSalt)(),
825
+ privateKey: users[0].privateKey.serialize(),
826
+ signer,
827
+ });
828
+ });
829
+ it("should generate zk-SNARK proofs and verify them", async () => {
830
+ await (0, sdk_1.timeTravel)({ seconds: constants_1.pollDuration, signer });
831
+ await (0, sdk_1.mergeSignups)({ ...constants_1.mergeSignupsArgs, maciAddress: maciAddresses.maciContractAddress, signer });
832
+ const { tallyData: tallyFileData } = await (0, sdk_1.generateProofs)({
833
+ ...generateProofsArgs,
834
+ maciAddress: maciAddresses.maciContractAddress,
835
+ signer,
836
+ });
837
+ await (0, sdk_1.proveOnChain)({ ...constants_1.proveOnChainArgs, maciAddress: maciAddresses.maciContractAddress, signer });
838
+ await (0, sdk_1.verify)({ ...(await (0, constants_1.verifyArgs)(signer)), tallyData: tallyFileData });
839
+ const totalSpent = constants_1.DEFAULT_INITIAL_VOICE_CREDITS.toString();
840
+ (0, chai_1.expect)(tallyFileData.totalSpentVoiceCredits.spent.toString()).to.eq(totalSpent);
841
+ (0, chai_1.expect)(tallyFileData.results.tally[0].toString()).to.eq(totalSpent);
842
+ });
843
+ });
844
+ });
845
+ //# sourceMappingURL=e2e.full.test.js.map