@maci-protocol/sdk 0.0.0-ci.00107eb

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 (326) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/LICENSE +21 -0
  3. package/README.md +12 -0
  4. package/build/package.json +65 -0
  5. package/build/ts/browser/index.d.ts +15 -0
  6. package/build/ts/browser/index.d.ts.map +1 -0
  7. package/build/ts/browser/index.js +40 -0
  8. package/build/ts/browser/index.js.map +1 -0
  9. package/build/ts/browser/joinPoll.d.ts +10 -0
  10. package/build/ts/browser/joinPoll.d.ts.map +1 -0
  11. package/build/ts/browser/joinPoll.js +88 -0
  12. package/build/ts/browser/joinPoll.js.map +1 -0
  13. package/build/ts/browser/utils.d.ts +18 -0
  14. package/build/ts/browser/utils.d.ts.map +1 -0
  15. package/build/ts/browser/utils.js +37 -0
  16. package/build/ts/browser/utils.js.map +1 -0
  17. package/build/ts/deploy/index.d.ts +6 -0
  18. package/build/ts/deploy/index.d.ts.map +1 -0
  19. package/build/ts/deploy/index.js +12 -0
  20. package/build/ts/deploy/index.js.map +1 -0
  21. package/build/ts/deploy/maci.d.ts +8 -0
  22. package/build/ts/deploy/maci.d.ts.map +1 -0
  23. package/build/ts/deploy/maci.js +97 -0
  24. package/build/ts/deploy/maci.js.map +1 -0
  25. package/build/ts/deploy/poll.d.ts +8 -0
  26. package/build/ts/deploy/poll.d.ts.map +1 -0
  27. package/build/ts/deploy/poll.js +112 -0
  28. package/build/ts/deploy/poll.js.map +1 -0
  29. package/build/ts/deploy/types.d.ts +225 -0
  30. package/build/ts/deploy/types.d.ts.map +1 -0
  31. package/build/ts/deploy/types.js +3 -0
  32. package/build/ts/deploy/types.js.map +1 -0
  33. package/build/ts/deploy/utils.d.ts +11 -0
  34. package/build/ts/deploy/utils.d.ts.map +1 -0
  35. package/build/ts/deploy/utils.js +22 -0
  36. package/build/ts/deploy/utils.js.map +1 -0
  37. package/build/ts/deploy/verifyingKeysRegistry.d.ts +7 -0
  38. package/build/ts/deploy/verifyingKeysRegistry.d.ts.map +1 -0
  39. package/build/ts/deploy/verifyingKeysRegistry.js +14 -0
  40. package/build/ts/deploy/verifyingKeysRegistry.js.map +1 -0
  41. package/build/ts/index.d.ts +17 -0
  42. package/build/ts/index.d.ts.map +1 -0
  43. package/build/ts/index.js +89 -0
  44. package/build/ts/index.js.map +1 -0
  45. package/build/ts/maci/index.d.ts +6 -0
  46. package/build/ts/maci/index.d.ts.map +1 -0
  47. package/build/ts/maci/index.js +17 -0
  48. package/build/ts/maci/index.js.map +1 -0
  49. package/build/ts/maci/merge.d.ts +9 -0
  50. package/build/ts/maci/merge.d.ts.map +1 -0
  51. package/build/ts/maci/merge.js +29 -0
  52. package/build/ts/maci/merge.js.map +1 -0
  53. package/build/ts/maci/policy.d.ts +53 -0
  54. package/build/ts/maci/policy.d.ts.map +1 -0
  55. package/build/ts/maci/policy.js +166 -0
  56. package/build/ts/maci/policy.js.map +1 -0
  57. package/build/ts/maci/state.d.ts +8 -0
  58. package/build/ts/maci/state.d.ts.map +1 -0
  59. package/build/ts/maci/state.js +82 -0
  60. package/build/ts/maci/state.js.map +1 -0
  61. package/build/ts/maci/types.d.ts +208 -0
  62. package/build/ts/maci/types.d.ts.map +1 -0
  63. package/build/ts/maci/types.js +20 -0
  64. package/build/ts/maci/types.js.map +1 -0
  65. package/build/ts/maciKeys/__tests__/keypair.test.d.ts +2 -0
  66. package/build/ts/maciKeys/__tests__/keypair.test.d.ts.map +1 -0
  67. package/build/ts/maciKeys/__tests__/keypair.test.js +24 -0
  68. package/build/ts/maciKeys/__tests__/keypair.test.js.map +1 -0
  69. package/build/ts/maciKeys/__tests__/publicKeys.test.d.ts +2 -0
  70. package/build/ts/maciKeys/__tests__/publicKeys.test.d.ts.map +1 -0
  71. package/build/ts/maciKeys/__tests__/publicKeys.test.js +22 -0
  72. package/build/ts/maciKeys/__tests__/publicKeys.test.js.map +1 -0
  73. package/build/ts/maciKeys/index.d.ts +4 -0
  74. package/build/ts/maciKeys/index.d.ts.map +1 -0
  75. package/build/ts/maciKeys/index.js +8 -0
  76. package/build/ts/maciKeys/index.js.map +1 -0
  77. package/build/ts/maciKeys/keypair.d.ts +9 -0
  78. package/build/ts/maciKeys/keypair.d.ts.map +1 -0
  79. package/build/ts/maciKeys/keypair.js +21 -0
  80. package/build/ts/maciKeys/keypair.js.map +1 -0
  81. package/build/ts/maciKeys/publicKeys.d.ts +8 -0
  82. package/build/ts/maciKeys/publicKeys.d.ts.map +1 -0
  83. package/build/ts/maciKeys/publicKeys.js +23 -0
  84. package/build/ts/maciKeys/publicKeys.js.map +1 -0
  85. package/build/ts/maciKeys/types.d.ts +28 -0
  86. package/build/ts/maciKeys/types.d.ts.map +1 -0
  87. package/build/ts/maciKeys/types.js +3 -0
  88. package/build/ts/maciKeys/types.js.map +1 -0
  89. package/build/ts/poll/index.d.ts +4 -0
  90. package/build/ts/poll/index.d.ts.map +1 -0
  91. package/build/ts/poll/index.js +9 -0
  92. package/build/ts/poll/index.js.map +1 -0
  93. package/build/ts/poll/poll.d.ts +14 -0
  94. package/build/ts/poll/poll.d.ts.map +1 -0
  95. package/build/ts/poll/poll.js +62 -0
  96. package/build/ts/poll/poll.js.map +1 -0
  97. package/build/ts/poll/types.d.ts +151 -0
  98. package/build/ts/poll/types.d.ts.map +1 -0
  99. package/build/ts/poll/types.js +3 -0
  100. package/build/ts/poll/types.js.map +1 -0
  101. package/build/ts/poll/utils.d.ts +9 -0
  102. package/build/ts/poll/utils.d.ts.map +1 -0
  103. package/build/ts/poll/utils.js +43 -0
  104. package/build/ts/poll/utils.js.map +1 -0
  105. package/build/ts/proof/__tests__/download.test.d.ts +2 -0
  106. package/build/ts/proof/__tests__/download.test.d.ts.map +1 -0
  107. package/build/ts/proof/__tests__/download.test.js +53 -0
  108. package/build/ts/proof/__tests__/download.test.js.map +1 -0
  109. package/build/ts/proof/download.d.ts +9 -0
  110. package/build/ts/proof/download.d.ts.map +1 -0
  111. package/build/ts/proof/download.js +47 -0
  112. package/build/ts/proof/download.js.map +1 -0
  113. package/build/ts/proof/generate.d.ts +8 -0
  114. package/build/ts/proof/generate.d.ts.map +1 -0
  115. package/build/ts/proof/generate.js +133 -0
  116. package/build/ts/proof/generate.js.map +1 -0
  117. package/build/ts/proof/index.d.ts +4 -0
  118. package/build/ts/proof/index.d.ts.map +1 -0
  119. package/build/ts/proof/index.js +8 -0
  120. package/build/ts/proof/index.js.map +1 -0
  121. package/build/ts/proof/prove.d.ts +8 -0
  122. package/build/ts/proof/prove.d.ts.map +1 -0
  123. package/build/ts/proof/prove.js +91 -0
  124. package/build/ts/proof/prove.js.map +1 -0
  125. package/build/ts/proof/types.d.ts +205 -0
  126. package/build/ts/proof/types.d.ts.map +1 -0
  127. package/build/ts/proof/types.js +3 -0
  128. package/build/ts/proof/types.js.map +1 -0
  129. package/build/ts/proof/utils.d.ts +10 -0
  130. package/build/ts/proof/utils.d.ts.map +1 -0
  131. package/build/ts/proof/utils.js +24 -0
  132. package/build/ts/proof/utils.js.map +1 -0
  133. package/build/ts/relayer/__tests__/messages.test.d.ts +2 -0
  134. package/build/ts/relayer/__tests__/messages.test.d.ts.map +1 -0
  135. package/build/ts/relayer/__tests__/messages.test.js +76 -0
  136. package/build/ts/relayer/__tests__/messages.test.js.map +1 -0
  137. package/build/ts/relayer/__tests__/utils.test.d.ts +2 -0
  138. package/build/ts/relayer/__tests__/utils.test.d.ts.map +1 -0
  139. package/build/ts/relayer/__tests__/utils.test.js +73 -0
  140. package/build/ts/relayer/__tests__/utils.test.js.map +1 -0
  141. package/build/ts/relayer/index.d.ts +3 -0
  142. package/build/ts/relayer/index.d.ts.map +1 -0
  143. package/build/ts/relayer/index.js +8 -0
  144. package/build/ts/relayer/index.js.map +1 -0
  145. package/build/ts/relayer/messages.d.ts +23 -0
  146. package/build/ts/relayer/messages.d.ts.map +1 -0
  147. package/build/ts/relayer/messages.js +66 -0
  148. package/build/ts/relayer/messages.js.map +1 -0
  149. package/build/ts/relayer/types.d.ts +168 -0
  150. package/build/ts/relayer/types.d.ts.map +1 -0
  151. package/build/ts/relayer/types.js +3 -0
  152. package/build/ts/relayer/types.js.map +1 -0
  153. package/build/ts/relayer/utils.d.ts +12 -0
  154. package/build/ts/relayer/utils.d.ts.map +1 -0
  155. package/build/ts/relayer/utils.js +37 -0
  156. package/build/ts/relayer/utils.js.map +1 -0
  157. package/build/ts/subgraph/index.d.ts +3 -0
  158. package/build/ts/subgraph/index.d.ts.map +1 -0
  159. package/build/ts/subgraph/index.js +18 -0
  160. package/build/ts/subgraph/index.js.map +1 -0
  161. package/build/ts/subgraph/maciSubgraph.d.ts +28 -0
  162. package/build/ts/subgraph/maciSubgraph.d.ts.map +1 -0
  163. package/build/ts/subgraph/maciSubgraph.js +64 -0
  164. package/build/ts/subgraph/maciSubgraph.js.map +1 -0
  165. package/build/ts/subgraph/types.d.ts +20 -0
  166. package/build/ts/subgraph/types.d.ts.map +1 -0
  167. package/build/ts/subgraph/types.js +3 -0
  168. package/build/ts/subgraph/types.js.map +1 -0
  169. package/build/ts/tally/commitments.d.ts +9 -0
  170. package/build/ts/tally/commitments.d.ts.map +1 -0
  171. package/build/ts/tally/commitments.js +43 -0
  172. package/build/ts/tally/commitments.js.map +1 -0
  173. package/build/ts/tally/index.d.ts +5 -0
  174. package/build/ts/tally/index.d.ts.map +1 -0
  175. package/build/ts/tally/index.js +12 -0
  176. package/build/ts/tally/index.js.map +1 -0
  177. package/build/ts/tally/results.d.ts +20 -0
  178. package/build/ts/tally/results.d.ts.map +1 -0
  179. package/build/ts/tally/results.js +49 -0
  180. package/build/ts/tally/results.js.map +1 -0
  181. package/build/ts/tally/types.d.ts +219 -0
  182. package/build/ts/tally/types.d.ts.map +1 -0
  183. package/build/ts/tally/types.js +3 -0
  184. package/build/ts/tally/types.js.map +1 -0
  185. package/build/ts/tally/utils.d.ts +24 -0
  186. package/build/ts/tally/utils.d.ts.map +1 -0
  187. package/build/ts/tally/utils.js +50 -0
  188. package/build/ts/tally/utils.js.map +1 -0
  189. package/build/ts/tally/verification.d.ts +7 -0
  190. package/build/ts/tally/verification.d.ts.map +1 -0
  191. package/build/ts/tally/verification.js +62 -0
  192. package/build/ts/tally/verification.js.map +1 -0
  193. package/build/ts/trees/index.d.ts +3 -0
  194. package/build/ts/trees/index.d.ts.map +1 -0
  195. package/build/ts/trees/index.js +8 -0
  196. package/build/ts/trees/index.js.map +1 -0
  197. package/build/ts/trees/stateTree.d.ts +35 -0
  198. package/build/ts/trees/stateTree.d.ts.map +1 -0
  199. package/build/ts/trees/stateTree.js +117 -0
  200. package/build/ts/trees/stateTree.js.map +1 -0
  201. package/build/ts/trees/types.d.ts +55 -0
  202. package/build/ts/trees/types.d.ts.map +1 -0
  203. package/build/ts/trees/types.js +3 -0
  204. package/build/ts/trees/types.js.map +1 -0
  205. package/build/ts/user/index.d.ts +5 -0
  206. package/build/ts/user/index.d.ts.map +1 -0
  207. package/build/ts/user/index.js +17 -0
  208. package/build/ts/user/index.js.map +1 -0
  209. package/build/ts/user/joinPoll.d.ts +8 -0
  210. package/build/ts/user/joinPoll.d.ts.map +1 -0
  211. package/build/ts/user/joinPoll.js +84 -0
  212. package/build/ts/user/joinPoll.js.map +1 -0
  213. package/build/ts/user/signup.d.ts +20 -0
  214. package/build/ts/user/signup.d.ts.map +1 -0
  215. package/build/ts/user/signup.js +84 -0
  216. package/build/ts/user/signup.js.map +1 -0
  217. package/build/ts/user/types.d.ts +460 -0
  218. package/build/ts/user/types.d.ts.map +1 -0
  219. package/build/ts/user/types.js +3 -0
  220. package/build/ts/user/types.js.map +1 -0
  221. package/build/ts/user/utils.d.ts +88 -0
  222. package/build/ts/user/utils.d.ts.map +1 -0
  223. package/build/ts/user/utils.js +258 -0
  224. package/build/ts/user/utils.js.map +1 -0
  225. package/build/ts/utils/cid.d.ts +23 -0
  226. package/build/ts/utils/cid.d.ts.map +1 -0
  227. package/build/ts/utils/cid.js +72 -0
  228. package/build/ts/utils/cid.js.map +1 -0
  229. package/build/ts/utils/constants.d.ts +2 -0
  230. package/build/ts/utils/constants.d.ts.map +1 -0
  231. package/build/ts/utils/constants.js +5 -0
  232. package/build/ts/utils/constants.js.map +1 -0
  233. package/build/ts/utils/contracts.d.ts +15 -0
  234. package/build/ts/utils/contracts.d.ts.map +1 -0
  235. package/build/ts/utils/contracts.js +26 -0
  236. package/build/ts/utils/contracts.js.map +1 -0
  237. package/build/ts/utils/files.d.ts +9 -0
  238. package/build/ts/utils/files.d.ts.map +1 -0
  239. package/build/ts/utils/files.js +20 -0
  240. package/build/ts/utils/files.js.map +1 -0
  241. package/build/ts/utils/formatting.d.ts +8 -0
  242. package/build/ts/utils/formatting.d.ts.map +1 -0
  243. package/build/ts/utils/formatting.js +11 -0
  244. package/build/ts/utils/formatting.js.map +1 -0
  245. package/build/ts/utils/fundWallet.d.ts +7 -0
  246. package/build/ts/utils/fundWallet.d.ts.map +1 -0
  247. package/build/ts/utils/fundWallet.js +20 -0
  248. package/build/ts/utils/fundWallet.js.map +1 -0
  249. package/build/ts/utils/index.d.ts +12 -0
  250. package/build/ts/utils/index.d.ts.map +1 -0
  251. package/build/ts/utils/index.js +29 -0
  252. package/build/ts/utils/index.js.map +1 -0
  253. package/build/ts/utils/params.d.ts +7 -0
  254. package/build/ts/utils/params.d.ts.map +1 -0
  255. package/build/ts/utils/params.js +19 -0
  256. package/build/ts/utils/params.js.map +1 -0
  257. package/build/ts/utils/proofs.d.ts +13 -0
  258. package/build/ts/utils/proofs.d.ts.map +1 -0
  259. package/build/ts/utils/proofs.js +41 -0
  260. package/build/ts/utils/proofs.js.map +1 -0
  261. package/build/ts/utils/timeTravel.d.ts +7 -0
  262. package/build/ts/utils/timeTravel.d.ts.map +1 -0
  263. package/build/ts/utils/timeTravel.js +14 -0
  264. package/build/ts/utils/timeTravel.js.map +1 -0
  265. package/build/ts/utils/trees.d.ts +13 -0
  266. package/build/ts/utils/trees.d.ts.map +1 -0
  267. package/build/ts/utils/trees.js +30 -0
  268. package/build/ts/utils/trees.js.map +1 -0
  269. package/build/ts/utils/types.d.ts +71 -0
  270. package/build/ts/utils/types.d.ts.map +1 -0
  271. package/build/ts/utils/types.js +3 -0
  272. package/build/ts/utils/types.js.map +1 -0
  273. package/build/ts/utils/utils.d.ts +29 -0
  274. package/build/ts/utils/utils.d.ts.map +1 -0
  275. package/build/ts/utils/utils.js +61 -0
  276. package/build/ts/utils/utils.js.map +1 -0
  277. package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts +10 -0
  278. package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts.map +1 -0
  279. package/build/ts/verifyingKeys/checkVerifyingKeys.js +66 -0
  280. package/build/ts/verifyingKeys/checkVerifyingKeys.js.map +1 -0
  281. package/build/ts/verifyingKeys/index.d.ts +5 -0
  282. package/build/ts/verifyingKeys/index.d.ts.map +1 -0
  283. package/build/ts/verifyingKeys/index.js +13 -0
  284. package/build/ts/verifyingKeys/index.js.map +1 -0
  285. package/build/ts/verifyingKeys/setVerifyingKeys.d.ts +7 -0
  286. package/build/ts/verifyingKeys/setVerifyingKeys.d.ts.map +1 -0
  287. package/build/ts/verifyingKeys/setVerifyingKeys.js +108 -0
  288. package/build/ts/verifyingKeys/setVerifyingKeys.js.map +1 -0
  289. package/build/ts/verifyingKeys/types.d.ts +239 -0
  290. package/build/ts/verifyingKeys/types.d.ts.map +1 -0
  291. package/build/ts/verifyingKeys/types.js +3 -0
  292. package/build/ts/verifyingKeys/types.js.map +1 -0
  293. package/build/ts/verifyingKeys/utils.d.ts +29 -0
  294. package/build/ts/verifyingKeys/utils.d.ts.map +1 -0
  295. package/build/ts/verifyingKeys/utils.js +118 -0
  296. package/build/ts/verifyingKeys/utils.js.map +1 -0
  297. package/build/ts/vote/generate.d.ts +8 -0
  298. package/build/ts/vote/generate.d.ts.map +1 -0
  299. package/build/ts/vote/generate.js +46 -0
  300. package/build/ts/vote/generate.js.map +1 -0
  301. package/build/ts/vote/index.d.ts +7 -0
  302. package/build/ts/vote/index.d.ts.map +1 -0
  303. package/build/ts/vote/index.js +17 -0
  304. package/build/ts/vote/index.js.map +1 -0
  305. package/build/ts/vote/invalidate.d.ts +13 -0
  306. package/build/ts/vote/invalidate.d.ts.map +1 -0
  307. package/build/ts/vote/invalidate.js +44 -0
  308. package/build/ts/vote/invalidate.js.map +1 -0
  309. package/build/ts/vote/publish.d.ts +14 -0
  310. package/build/ts/vote/publish.d.ts.map +1 -0
  311. package/build/ts/vote/publish.js +88 -0
  312. package/build/ts/vote/publish.js.map +1 -0
  313. package/build/ts/vote/submit.d.ts +13 -0
  314. package/build/ts/vote/submit.d.ts.map +1 -0
  315. package/build/ts/vote/submit.js +36 -0
  316. package/build/ts/vote/submit.js.map +1 -0
  317. package/build/ts/vote/types.d.ts +238 -0
  318. package/build/ts/vote/types.d.ts.map +1 -0
  319. package/build/ts/vote/types.js +3 -0
  320. package/build/ts/vote/types.js.map +1 -0
  321. package/build/ts/vote/utils.d.ts +16 -0
  322. package/build/ts/vote/utils.d.ts.map +1 -0
  323. package/build/ts/vote/utils.js +26 -0
  324. package/build/ts/vote/utils.js.map +1 -0
  325. package/build/tsconfig.build.tsbuildinfo +1 -0
  326. package/package.json +66 -0
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.generateProofs = void 0;
7
+ const contracts_1 = require("@maci-protocol/contracts");
8
+ const domainobjs_1 = require("@maci-protocol/domainobjs");
9
+ const fs_1 = __importDefault(require("fs"));
10
+ const utils_1 = require("../poll/utils");
11
+ const files_1 = require("../utils/files");
12
+ /**
13
+ * Generate proofs for the message processing and tally calculations
14
+ * @param args - The arguments for the generateProofs command
15
+ * @returns The tally data
16
+ */
17
+ const generateProofs = async ({ outputDir, coordinatorPrivateKey, signer, maciAddress, pollId, ipfsMessageBackupFiles, stateFile, transactionHash, startBlock, endBlock, blocksPerBatch, rapidsnark, mode, voteTallyZkey, voteTallyWitnessGenerator, voteTallyWasm, messageProcessorZkey, messageProcessorWitnessGenerator, messageProcessorWasm, messageProcessorWitnessDatFile, voteTallyWitnessDatFile, tallyFile, useWasm, }) => {
18
+ // differentiate whether we are using wasm or rapidsnark
19
+ if (useWasm) {
20
+ // if no rapidsnark then we assume we go with wasm
21
+ // so we expect those arguments
22
+ if (!messageProcessorWasm) {
23
+ throw new Error("Please specify the process wasm file location");
24
+ }
25
+ if (!voteTallyWasm) {
26
+ throw new Error("Please specify the tally wasm file location");
27
+ }
28
+ const wasmResult = (0, files_1.doesPathExist)([messageProcessorWasm, voteTallyWasm]);
29
+ if (!wasmResult[0]) {
30
+ throw new Error(`Could not find ${wasmResult[1]}.`);
31
+ }
32
+ }
33
+ else {
34
+ if (!rapidsnark) {
35
+ throw new Error("Please specify the rapidsnark file location");
36
+ }
37
+ if (!messageProcessorWitnessGenerator) {
38
+ throw new Error("Please specify the process witnessGenerator file location");
39
+ }
40
+ if (!voteTallyWitnessGenerator) {
41
+ throw new Error("Please specify the tally witnessGenerator file location");
42
+ }
43
+ const witnessGeneratorResult = (0, files_1.doesPathExist)([
44
+ rapidsnark,
45
+ messageProcessorWitnessGenerator,
46
+ voteTallyWitnessGenerator,
47
+ messageProcessorWitnessDatFile,
48
+ voteTallyWitnessDatFile,
49
+ ]);
50
+ if (!witnessGeneratorResult[0]) {
51
+ throw new Error(`Could not find ${witnessGeneratorResult[1]}.`);
52
+ }
53
+ }
54
+ // check if zkeys were provided
55
+ const zkResult = (0, files_1.doesPathExist)([messageProcessorZkey, voteTallyZkey]);
56
+ if (!zkResult[0]) {
57
+ throw new Error(`Could not find ${zkResult[1]}.`);
58
+ }
59
+ const network = await signer.provider?.getNetwork();
60
+ if (!maciAddress) {
61
+ throw new Error("Please provide a MACI contract address");
62
+ }
63
+ // the coordinator's MACI private key
64
+ if (!domainobjs_1.PrivateKey.isValidSerialized(coordinatorPrivateKey)) {
65
+ throw new Error("Invalid MACI private key");
66
+ }
67
+ // if we do not have the output directory just create it
68
+ const isOutputDirExists = fs_1.default.existsSync(outputDir);
69
+ if (!isOutputDirExists) {
70
+ // Create the directory
71
+ await fs_1.default.promises.mkdir(outputDir);
72
+ }
73
+ const maciPrivateKey = domainobjs_1.PrivateKey.deserialize(coordinatorPrivateKey);
74
+ const coordinatorKeypair = new domainobjs_1.Keypair(maciPrivateKey);
75
+ const { poll: pollContract, maci: maciContract, tally: tallyContract, } = await (0, utils_1.getPollContracts)({
76
+ maciAddress,
77
+ pollId,
78
+ signer,
79
+ });
80
+ const [isStateAqMerged, tallyContractAddress] = await Promise.all([
81
+ pollContract.stateMerged(),
82
+ tallyContract.getAddress(),
83
+ ]);
84
+ // Check that the state and message trees have been merged
85
+ if (!isStateAqMerged) {
86
+ throw new Error("The state tree has not been merged yet. Please use the mergeSignups subcommand to do so.");
87
+ }
88
+ const maciState = await contracts_1.ProofGenerator.prepareState({
89
+ maciContract,
90
+ pollContract,
91
+ maciPrivateKey,
92
+ coordinatorKeypair,
93
+ pollId,
94
+ signer,
95
+ outputDir,
96
+ ipfsMessageBackupFiles,
97
+ options: {
98
+ stateFile,
99
+ transactionHash,
100
+ startBlock,
101
+ endBlock,
102
+ blocksPerBatch,
103
+ },
104
+ });
105
+ const foundPoll = maciState.polls.get(BigInt(pollId));
106
+ if (!foundPoll) {
107
+ throw new Error(`Poll ${pollId} not found`);
108
+ }
109
+ const proofGenerator = new contracts_1.ProofGenerator({
110
+ poll: foundPoll,
111
+ maciContractAddress: maciAddress,
112
+ tallyContractAddress,
113
+ rapidsnark,
114
+ tally: {
115
+ zkey: voteTallyZkey,
116
+ witnessGenerator: voteTallyWitnessGenerator,
117
+ wasm: useWasm ? voteTallyWasm : undefined,
118
+ },
119
+ messageProcessor: {
120
+ zkey: messageProcessorZkey,
121
+ witnessGenerator: messageProcessorWitnessGenerator,
122
+ wasm: useWasm ? messageProcessorWasm : undefined,
123
+ },
124
+ outputDir,
125
+ tallyOutputFile: tallyFile,
126
+ mode,
127
+ });
128
+ const processProofs = await proofGenerator.generateMpProofs();
129
+ const { proofs: tallyProofs, tallyData } = await proofGenerator.generateTallyProofs(network?.name ?? "", network?.chainId.toString() ?? "0");
130
+ return { processProofs, tallyProofs, tallyData };
131
+ };
132
+ exports.generateProofs = generateProofs;
133
+ //# sourceMappingURL=generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../ts/proof/generate.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA0D;AAC1D,0DAAgE;AAEhE,4CAAoB;AAIpB,yCAAiD;AACjD,0CAA+C;AAE/C;;;;GAIG;AACI,MAAM,cAAc,GAAG,KAAK,EAAE,EACnC,SAAS,EACT,qBAAqB,EACrB,MAAM,EACN,WAAW,EACX,MAAM,EACN,sBAAsB,EACtB,SAAS,EACT,eAAe,EACf,UAAU,EACV,QAAQ,EACR,cAAc,EACd,UAAU,EACV,IAAI,EACJ,aAAa,EACb,yBAAyB,EACzB,aAAa,EACb,oBAAoB,EACpB,gCAAgC,EAChC,oBAAoB,EACpB,8BAA8B,EAC9B,uBAAuB,EACvB,SAAS,EACT,OAAO,GACa,EAAgC,EAAE;IACtD,wDAAwD;IACxD,IAAI,OAAO,EAAE,CAAC;QACZ,kDAAkD;QAClD,+BAA+B;QAC/B,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,CAAC;QAED,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAC,CAAC;QAExE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,kBAAkB,UAAU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M,YAAY,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,cAAc,GAAG,IAAI,0BAAc,CAAC;QACxC,IAAI,EAAE,SAAS;QACf,mBAAmB,EAAE,WAAW;QAChC,oBAAoB;QACpB,UAAU;QACV,KAAK,EAAE;YACL,IAAI,EAAE,aAAa;YACnB,gBAAgB,EAAE,yBAAyB;YAC3C,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS;SAC1C;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,oBAAoB;YAC1B,gBAAgB,EAAE,gCAAgC;YAClD,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS;SACjD;QACD,SAAS;QACT,eAAe,EAAE,SAAS;QAC1B,IAAI;KACL,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,MAAM,cAAc,CAAC,gBAAgB,EAAE,CAAC;IAC9D,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,MAAM,cAAc,CAAC,mBAAmB,CACjF,OAAO,EAAE,IAAI,IAAI,EAAE,EACnB,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,CACnC,CAAC;IAEF,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AACnD,CAAC,CAAC;AAxKW,QAAA,cAAc,kBAwKzB"}
@@ -0,0 +1,4 @@
1
+ export type { IGenerateProofsArgs, IGenerateProofsData, IProof, IProveOnChainArgs } from "./types";
2
+ export { generateProofs } from "./generate";
3
+ export { proveOnChain } from "./prove";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/proof/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.proveOnChain = exports.generateProofs = void 0;
4
+ var generate_1 = require("./generate");
5
+ Object.defineProperty(exports, "generateProofs", { enumerable: true, get: function () { return generate_1.generateProofs; } });
6
+ var prove_1 = require("./prove");
7
+ Object.defineProperty(exports, "proveOnChain", { enumerable: true, get: function () { return prove_1.proveOnChain; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/proof/index.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAAnC,0GAAA,cAAc,OAAA;AACvB,iCAAuC;AAA9B,qGAAA,YAAY,OAAA"}
@@ -0,0 +1,8 @@
1
+ import type { ITallyData } from "../tally";
2
+ import type { IProveOnChainArgs } from "./types";
3
+ /**
4
+ * Command to prove the result of a poll on-chain
5
+ * @param args - The arguments for the proveOnChain command
6
+ */
7
+ export declare const proveOnChain: ({ pollId, proofDir, maciAddress, tallyFile, useBatchSubmission, signer, }: IProveOnChainArgs) => Promise<ITallyData | undefined>;
8
+ //# sourceMappingURL=prove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../../../ts/proof/prove.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAU,MAAM,SAAS,CAAC;AAKzD;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAU,2EAOhC,iBAAiB,KAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAgGpD,CAAC"}
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.proveOnChain = void 0;
7
+ /* eslint-disable no-await-in-loop */
8
+ const contracts_1 = require("@maci-protocol/contracts");
9
+ const typechain_types_1 = require("@maci-protocol/contracts/typechain-types");
10
+ const fs_1 = __importDefault(require("fs"));
11
+ const utils_1 = require("../poll/utils");
12
+ const contracts_2 = require("../utils/contracts");
13
+ /**
14
+ * Command to prove the result of a poll on-chain
15
+ * @param args - The arguments for the proveOnChain command
16
+ */
17
+ const proveOnChain = async ({ pollId, proofDir, maciAddress, tallyFile, useBatchSubmission, signer, }) => {
18
+ const deployment = contracts_1.Deployment.getInstance();
19
+ deployment.setContractNames(contracts_1.EContracts);
20
+ const { maci: maciContract, poll: pollContract, messageProcessor: messageProcessorContract, tally: tallyContract, } = await (0, utils_1.getPollContracts)({ maciAddress, pollId, signer });
21
+ const verifyingKeysRegistryContractAddress = await tallyContract.verifyingKeysRegistry();
22
+ const [isStateAqMerged, isVerifyingKeyRegistryExists] = await Promise.all([
23
+ pollContract.stateMerged(),
24
+ (0, contracts_2.contractExists)(signer.provider, verifyingKeysRegistryContractAddress),
25
+ ]);
26
+ if (!isVerifyingKeyRegistryExists) {
27
+ throw new Error("There is no VerifyingKeysRegistry contract linked to the specified MACI contract.");
28
+ }
29
+ const verifyingKeysRegistryContract = await deployment.getContract({
30
+ name: contracts_1.EContracts.VerifyingKeysRegistry,
31
+ address: verifyingKeysRegistryContractAddress,
32
+ abi: typechain_types_1.VerifyingKeysRegistry__factory.abi,
33
+ signer,
34
+ });
35
+ const verifierContractAddress = await messageProcessorContract.verifier();
36
+ const isVerifierExists = await (0, contracts_2.contractExists)(signer.provider, verifierContractAddress);
37
+ if (!isVerifierExists) {
38
+ throw new Error("There is no Verifier contract linked to the specified MACI contract.");
39
+ }
40
+ const verifierContract = await deployment.getContract({
41
+ name: contracts_1.EContracts.Verifier,
42
+ address: verifierContractAddress,
43
+ abi: typechain_types_1.Verifier__factory.abi,
44
+ signer,
45
+ });
46
+ // Check that the state and message trees have been merged for at least the first poll
47
+ if (!isStateAqMerged && pollId.toString() === "0") {
48
+ throw new Error("The state tree has not been merged yet. Please use the mergeSignups subcommand to do so.");
49
+ }
50
+ const data = {
51
+ processProofs: [],
52
+ tallyProofs: [],
53
+ };
54
+ // read the proofs from the output directory
55
+ const files = await fs_1.default.promises.readdir(proofDir);
56
+ // Read process proofs
57
+ data.processProofs = await (0, contracts_1.readProofs)({ files, folder: proofDir, type: "process" });
58
+ // Read tally proofs
59
+ data.tallyProofs = await (0, contracts_1.readProofs)({ files, folder: proofDir, type: "tally" });
60
+ const prover = new contracts_1.Prover({
61
+ maciContract,
62
+ messageProcessorContract,
63
+ pollContract,
64
+ verifyingKeysRegistryContract,
65
+ verifierContract,
66
+ tallyContract,
67
+ });
68
+ await prover.proveMessageProcessing(data.processProofs);
69
+ await prover.proveTally(data.tallyProofs);
70
+ if (tallyFile) {
71
+ const tallyData = await fs_1.default.promises
72
+ .readFile(tallyFile, "utf8")
73
+ .then((result) => JSON.parse(result));
74
+ const [voteOptions, messageBatchSize] = await Promise.all([
75
+ pollContract.voteOptions().then((number) => Number.parseInt(number.toString(), 10)),
76
+ pollContract.messageBatchSize().then((number) => Number.parseInt(number.toString(), 10)),
77
+ ]);
78
+ const totalTallyBatches = useBatchSubmission ? Math.ceil(voteOptions / messageBatchSize) : 1;
79
+ for (let index = 0; index < totalTallyBatches; index += 1) {
80
+ const start = messageBatchSize * index;
81
+ const end = useBatchSubmission ? Math.min(messageBatchSize * (index + 1), voteOptions) : voteOptions;
82
+ if (start < end) {
83
+ await prover.submitResults(tallyData, { start, end });
84
+ }
85
+ }
86
+ return tallyData;
87
+ }
88
+ return undefined;
89
+ };
90
+ exports.proveOnChain = proveOnChain;
91
+ //# sourceMappingURL=prove.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prove.js","sourceRoot":"","sources":["../../../ts/proof/prove.ts"],"names":[],"mappings":";;;;;;AAAA,q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C;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAvGW,QAAA,YAAY,gBAuGvB"}
@@ -0,0 +1,205 @@
1
+ import type { ITallyData } from "../tally/types";
2
+ import type { Groth16Proof, SnarkProof } from "@maci-protocol/contracts";
3
+ import type { EMode, TCircuitInputs } from "@maci-protocol/core";
4
+ import type { BigNumberish, Signer } from "ethers";
5
+ import type { PublicSignals } from "snarkjs";
6
+ /**
7
+ * Interface for the arguments to the proveOnChain command
8
+ */
9
+ export interface IProveOnChainArgs {
10
+ /**
11
+ * The id of the poll
12
+ */
13
+ pollId: bigint;
14
+ /**
15
+ * The directory containing the proofs
16
+ */
17
+ proofDir: string;
18
+ /**
19
+ * A signer object
20
+ */
21
+ signer: Signer;
22
+ /**
23
+ * The address of the MACI contract
24
+ */
25
+ maciAddress: string;
26
+ /**
27
+ * The tally file with results, per vote option spent credits, spent voice credits total
28
+ */
29
+ tallyFile?: string;
30
+ /**
31
+ * Whether to use batch submission
32
+ */
33
+ useBatchSubmission?: boolean;
34
+ }
35
+ /**
36
+ * Proof interface for sdk commands
37
+ */
38
+ export interface IProof {
39
+ /**
40
+ * Proof
41
+ */
42
+ proof: SnarkProof | Groth16Proof;
43
+ /**
44
+ * Circuit inputs
45
+ */
46
+ circuitInputs: TCircuitInputs;
47
+ /**
48
+ * Public signals
49
+ */
50
+ publicInputs: PublicSignals;
51
+ }
52
+ /**
53
+ * Arguments for the generateProofs function
54
+ */
55
+ export interface IGenerateProofsArgs {
56
+ /**
57
+ * The output directory
58
+ */
59
+ outputDir: string;
60
+ /**
61
+ * The coordinator private key
62
+ */
63
+ coordinatorPrivateKey: string;
64
+ /**
65
+ * The signer
66
+ */
67
+ signer: Signer;
68
+ /**
69
+ * The maci contract address
70
+ */
71
+ maciAddress: string;
72
+ /**
73
+ * The poll id
74
+ */
75
+ pollId: BigNumberish;
76
+ /**
77
+ * The ipfs message backup files
78
+ */
79
+ ipfsMessageBackupFiles?: string[];
80
+ /**
81
+ * The state file
82
+ */
83
+ stateFile?: string;
84
+ /**
85
+ * The transaction hash
86
+ */
87
+ transactionHash?: string;
88
+ /**
89
+ * The start block
90
+ */
91
+ startBlock?: number;
92
+ /**
93
+ * The end block
94
+ */
95
+ endBlock?: number;
96
+ /**
97
+ * The blocks per batch
98
+ */
99
+ blocksPerBatch?: number;
100
+ /**
101
+ * The rapidsnark path
102
+ */
103
+ rapidsnark?: string;
104
+ /**
105
+ * The path to the process dat file
106
+ */
107
+ messageProcessorWitnessDatFile?: string;
108
+ /**
109
+ * The path to the tally dat file
110
+ */
111
+ voteTallyWitnessDatFile?: string;
112
+ /**
113
+ * The use quadratic voting
114
+ */
115
+ mode: EMode;
116
+ /**
117
+ * Whether to use wasm or rapidsnark
118
+ */
119
+ useWasm?: boolean;
120
+ /**
121
+ * The tally zkey
122
+ */
123
+ voteTallyZkey: string;
124
+ /**
125
+ * The tally witness generator
126
+ */
127
+ voteTallyWitnessGenerator?: string;
128
+ /**
129
+ * The tally wasm
130
+ */
131
+ voteTallyWasm?: string;
132
+ /**
133
+ * The process zkey
134
+ */
135
+ messageProcessorZkey: string;
136
+ /**
137
+ * The process witness generator
138
+ */
139
+ messageProcessorWitnessGenerator?: string;
140
+ /**
141
+ * The process wasm
142
+ */
143
+ messageProcessorWasm?: string;
144
+ /**
145
+ * The tally file
146
+ */
147
+ tallyFile: string;
148
+ }
149
+ /**
150
+ * Interface for the data returned by the generateProofs function
151
+ */
152
+ export interface IGenerateProofsData {
153
+ /**
154
+ * Process proofs
155
+ */
156
+ processProofs: IProof[];
157
+ /**
158
+ * Tally proofs
159
+ */
160
+ tallyProofs: IProof[];
161
+ /**
162
+ * Tally data
163
+ */
164
+ tallyData: ITallyData;
165
+ }
166
+ /**
167
+ * Interface for the poll joining artifacts
168
+ */
169
+ export interface IPollJoiningArtifacts {
170
+ /**
171
+ * The zkey
172
+ */
173
+ zKey: Uint8Array;
174
+ /**
175
+ * The wasm
176
+ */
177
+ wasm: Uint8Array;
178
+ }
179
+ /**
180
+ * The url of the poll joining artifacts
181
+ */
182
+ export interface IPollJoiningArtifactsUrl {
183
+ /**
184
+ * The url of the poll joining zkey
185
+ */
186
+ zKeyUrl: string;
187
+ /**
188
+ * The url of the poll joining wasm
189
+ */
190
+ wasmUrl: string;
191
+ }
192
+ /**
193
+ * The arguments to download the poll joining artifacts for the browser
194
+ */
195
+ export interface IDownloadPollJoiningArtifactsBrowserArgs {
196
+ /**
197
+ * The depth of the state tree
198
+ */
199
+ stateTreeDepth: number;
200
+ /**
201
+ * Whether to download the testing artifacts
202
+ */
203
+ testing?: boolean;
204
+ }
205
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../ts/proof/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,KAAK,EAAE,UAAU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E,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB;;OAEG;IACH,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACvD;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../ts/proof/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import type { IPollJoiningArtifactsUrl } from "./types";
2
+ /**
3
+ * Get the url of the poll joining artifacts
4
+ *
5
+ * @param testing - Whether to get the testing artifacts
6
+ * @param stateTreeDepth - The depth of the state tree
7
+ * @returns The url of the poll joining artifacts
8
+ */
9
+ export declare const getPollJoiningArtifactsUrl: (testing: boolean, stateTreeDepth: number) => IPollJoiningArtifactsUrl;
10
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../ts/proof/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAI,SAAS,OAAO,EAAE,gBAAgB,MAAM,KAAG,wBAYrF,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPollJoiningArtifactsUrl = void 0;
4
+ /**
5
+ * Get the url of the poll joining artifacts
6
+ *
7
+ * @param testing - Whether to get the testing artifacts
8
+ * @param stateTreeDepth - The depth of the state tree
9
+ * @returns The url of the poll joining artifacts
10
+ */
11
+ const getPollJoiningArtifactsUrl = (testing, stateTreeDepth) => {
12
+ if (testing) {
13
+ return {
14
+ zKeyUrl: `https://maci-develop-fra.s3.eu-central-1.amazonaws.com/v3.0.0/browser-poll-join/testing/PollJoining_${stateTreeDepth}_test.0.zkey`,
15
+ wasmUrl: `https://maci-develop-fra.s3.eu-central-1.amazonaws.com/v3.0.0/browser-poll-join/testing/PollJoining_${stateTreeDepth}_test.wasm`,
16
+ };
17
+ }
18
+ return {
19
+ zKeyUrl: `https://maci-develop-fra.s3.eu-central-1.amazonaws.com/v3.0.0/browser-poll-join/production/PollJoining_${stateTreeDepth}.0.zkey`,
20
+ wasmUrl: `https://maci-develop-fra.s3.eu-central-1.amazonaws.com/v3.0.0/browser-poll-join/production/PollJoining_${stateTreeDepth}.wasm`,
21
+ };
22
+ };
23
+ exports.getPollJoiningArtifactsUrl = getPollJoiningArtifactsUrl;
24
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../ts/proof/utils.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACI,MAAM,0BAA0B,GAAG,CAAC,OAAgB,EAAE,cAAsB,EAA4B,EAAE;IAC/G,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO;YACL,OAAO,EAAE,uGAAuG,cAAc,cAAc;YAC5I,OAAO,EAAE,uGAAuG,cAAc,YAAY;SAC3I,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,0GAA0G,cAAc,SAAS;QAC1I,OAAO,EAAE,0GAA0G,cAAc,OAAO;KACzI,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,0BAA0B,8BAYrC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=messages.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.test.d.ts","sourceRoot":"","sources":["../../../../ts/relayer/__tests__/messages.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const domainobjs_1 = require("@maci-protocol/domainobjs");
4
+ const ethers_1 = require("ethers");
5
+ const __1 = require("..");
6
+ const utils_1 = require("../../poll/utils");
7
+ const utils_2 = require("../utils");
8
+ jest.mock("../../poll/utils", () => ({
9
+ getPollContracts: jest.fn(),
10
+ }));
11
+ jest.mock("../utils", () => ({
12
+ parseIpfsHashAddedEvents: jest.fn(),
13
+ }));
14
+ describe("messages", () => {
15
+ const keypair = new domainobjs_1.Keypair();
16
+ const defaultMessages = [
17
+ {
18
+ publicKey: keypair.publicKey.asArray().map(String),
19
+ data: new Array(10).fill("0"),
20
+ hash: "hash",
21
+ maciAddress: ethers_1.ZeroAddress,
22
+ poll: 0,
23
+ },
24
+ ];
25
+ describe("getRelayedMessages", () => {
26
+ const defaultArgs = {
27
+ maciAddress: ethers_1.ZeroAddress,
28
+ pollId: 0,
29
+ signer: {},
30
+ provider: {},
31
+ };
32
+ beforeEach(() => {
33
+ utils_1.getPollContracts.mockResolvedValue({ poll: {} });
34
+ utils_2.parseIpfsHashAddedEvents.mockResolvedValue({ messages: defaultMessages });
35
+ });
36
+ afterEach(() => {
37
+ jest.clearAllMocks();
38
+ });
39
+ test("should get relayed messages properly", async () => {
40
+ const { messages } = await (0, __1.getRelayedMessages)(defaultArgs);
41
+ expect(messages).toStrictEqual(defaultMessages);
42
+ });
43
+ });
44
+ describe("getMessageBatches", () => {
45
+ const defaultArgs = {
46
+ maciContractAddress: ethers_1.ZeroAddress,
47
+ poll: 0,
48
+ url: "url",
49
+ limit: 10,
50
+ skip: 0,
51
+ ipfsHashes: ["hash"],
52
+ publicKeys: ["key"],
53
+ messageHashes: ["hash"],
54
+ };
55
+ const defaultMessageBatches = [
56
+ {
57
+ messages: defaultMessages,
58
+ ipfsHash: "hash",
59
+ },
60
+ ];
61
+ beforeEach(() => {
62
+ jest.spyOn(global, "fetch").mockResolvedValue({
63
+ json: jest.fn().mockResolvedValue(defaultMessageBatches),
64
+ });
65
+ });
66
+ afterEach(() => {
67
+ jest.clearAllMocks();
68
+ jest.restoreAllMocks();
69
+ });
70
+ test("should get message batches properly", async () => {
71
+ const { messageBatches } = await (0, __1.getMessageBatches)(defaultArgs);
72
+ expect(messageBatches).toStrictEqual(defaultMessageBatches);
73
+ });
74
+ });
75
+ });
76
+ //# sourceMappingURL=messages.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.test.js","sourceRoot":"","sources":["../../../../ts/relayer/__tests__/messages.test.ts"],"names":[],"mappings":";;AAAA,0DAAoD;AACpD,mCAAiE;AAIjE,0BAMY;AACZ,4CAAoD;AACpD,oCAAoD;AAEpD,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAY,EAAE,CAAC,CAAC;IAC5C,gBAAgB,EAAE,IAAI,CAAC,EAAE,EAAE;CAC5B,CAAC,CAAC,CAAC;AAEJ,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAY,EAAE,CAAC,CAAC;IACpC,wBAAwB,EAAE,IAAI,CAAC,EAAE,EAAE;CACpC,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,MAAM,OAAO,GAAG,IAAI,oBAAO,EAAE,CAAC;IAE9B,MAAM,eAAe,GAAmB;QACtC;YACE,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,MAAM,CAAqB;YACt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YAC7C;gBACE,QAAQ,EAAE,eAAe;gBACzB,QAAQ,EAAE,MAAM;aACjB;SACF,CAAC;QAEF,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,iBAAiB,CAAC;gBAC5C,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,qBAAqB,CAAC;aAClC,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,GAAG,EAAE;YACb,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;YACrD,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,IAAA,qBAAiB,EAAC,WAAW,CAAC,CAAC;YAEhE,MAAM,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;QAC9D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=utils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../../../ts/relayer/__tests__/utils.test.ts"],"names":[],"mappings":""}