@maci-protocol/coordinator 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 (232) hide show
  1. package/LICENSE +1 -2
  2. package/README.md +71 -10
  3. package/build/hardhat.config.cjs +9 -3
  4. package/build/hardhat.config.cjs.map +1 -1
  5. package/build/hardhat.config.d.cts +9 -4
  6. package/build/scripts/generateKeypair.js +2 -2
  7. package/build/scripts/generateKeypair.js.map +1 -1
  8. package/build/scripts/generateMaciKeyPair.js +2 -2
  9. package/build/scripts/generateMaciKeyPair.js.map +1 -1
  10. package/build/tests/constants.d.ts +3 -4
  11. package/build/tests/constants.d.ts.map +1 -1
  12. package/build/tests/constants.js +5 -4
  13. package/build/tests/constants.js.map +1 -1
  14. package/build/tests/e2e.deploy.test.js +132 -102
  15. package/build/tests/e2e.deploy.test.js.map +1 -1
  16. package/build/tests/e2e.redis.test.d.ts +2 -0
  17. package/build/tests/e2e.redis.test.d.ts.map +1 -0
  18. package/build/tests/e2e.redis.test.js +118 -0
  19. package/build/tests/e2e.redis.test.js.map +1 -0
  20. package/build/tests/utils.d.ts +7 -1
  21. package/build/tests/utils.d.ts.map +1 -1
  22. package/build/tests/utils.js +17 -6
  23. package/build/tests/utils.js.map +1 -1
  24. package/build/ts/app.module.d.ts.map +1 -1
  25. package/build/ts/app.module.js +6 -0
  26. package/build/ts/app.module.js.map +1 -1
  27. package/build/ts/common/__tests__/common.test.js +44 -46
  28. package/build/ts/common/__tests__/common.test.js.map +1 -1
  29. package/build/ts/common/accountAbstraction.d.ts +7 -24
  30. package/build/ts/common/accountAbstraction.d.ts.map +1 -1
  31. package/build/ts/common/accountAbstraction.js +22 -49
  32. package/build/ts/common/accountAbstraction.js.map +1 -1
  33. package/build/ts/common/chain.d.ts +22 -0
  34. package/build/ts/common/chain.d.ts.map +1 -0
  35. package/build/ts/common/chain.js +37 -0
  36. package/build/ts/common/chain.js.map +1 -0
  37. package/build/ts/common/coordinatorKeypair.d.ts +7 -0
  38. package/build/ts/common/coordinatorKeypair.d.ts.map +1 -0
  39. package/build/ts/common/coordinatorKeypair.js +14 -0
  40. package/build/ts/common/coordinatorKeypair.js.map +1 -0
  41. package/build/ts/common/errors.d.ts +13 -10
  42. package/build/ts/common/errors.d.ts.map +1 -1
  43. package/build/ts/common/errors.js +12 -9
  44. package/build/ts/common/errors.js.map +1 -1
  45. package/build/ts/common/http.d.ts +6 -0
  46. package/build/ts/common/http.d.ts.map +1 -0
  47. package/build/ts/common/http.js +49 -0
  48. package/build/ts/common/http.js.map +1 -0
  49. package/build/ts/common/index.d.ts +3 -1
  50. package/build/ts/common/index.d.ts.map +1 -1
  51. package/build/ts/common/index.js +3 -1
  52. package/build/ts/common/index.js.map +1 -1
  53. package/build/ts/common/networks.d.ts +2 -21
  54. package/build/ts/common/networks.d.ts.map +1 -1
  55. package/build/ts/common/networks.js +39 -48
  56. package/build/ts/common/networks.js.map +1 -1
  57. package/build/ts/common/types.d.ts +3 -4
  58. package/build/ts/common/types.d.ts.map +1 -1
  59. package/build/ts/deployer/__tests__/deployer.controller.test.js +23 -25
  60. package/build/ts/deployer/__tests__/deployer.controller.test.js.map +1 -1
  61. package/build/ts/deployer/__tests__/deployer.service.test.js +182 -337
  62. package/build/ts/deployer/__tests__/deployer.service.test.js.map +1 -1
  63. package/build/ts/deployer/__tests__/utils.d.ts +31 -6
  64. package/build/ts/deployer/__tests__/utils.d.ts.map +1 -1
  65. package/build/ts/deployer/__tests__/utils.js +47 -16
  66. package/build/ts/deployer/__tests__/utils.js.map +1 -1
  67. package/build/ts/deployer/deployer.controller.d.ts.map +1 -1
  68. package/build/ts/deployer/deployer.controller.js +19 -6
  69. package/build/ts/deployer/deployer.controller.js.map +1 -1
  70. package/build/ts/deployer/deployer.service.d.ts +26 -53
  71. package/build/ts/deployer/deployer.service.d.ts.map +1 -1
  72. package/build/ts/deployer/deployer.service.js +343 -468
  73. package/build/ts/deployer/deployer.service.js.map +1 -1
  74. package/build/ts/deployer/dto.d.ts +7 -7
  75. package/build/ts/deployer/dto.d.ts.map +1 -1
  76. package/build/ts/deployer/dto.js +14 -6
  77. package/build/ts/deployer/dto.js.map +1 -1
  78. package/build/ts/deployer/types.d.ts +83 -46
  79. package/build/ts/deployer/types.d.ts.map +1 -1
  80. package/build/ts/file/__tests__/file.service.test.js +12 -11
  81. package/build/ts/file/__tests__/file.service.test.js.map +1 -1
  82. package/build/ts/file/file.service.d.ts +4 -3
  83. package/build/ts/file/file.service.d.ts.map +1 -1
  84. package/build/ts/file/file.service.js +16 -10
  85. package/build/ts/file/file.service.js.map +1 -1
  86. package/build/ts/file/types.d.ts +2 -2
  87. package/build/ts/file/types.d.ts.map +1 -1
  88. package/build/ts/health/__tests__/health.controller.test.d.ts +2 -0
  89. package/build/ts/health/__tests__/health.controller.test.d.ts.map +1 -0
  90. package/build/ts/health/__tests__/health.controller.test.js +52 -0
  91. package/build/ts/health/__tests__/health.controller.test.js.map +1 -0
  92. package/build/ts/health/__tests__/health.service.test.d.ts +2 -0
  93. package/build/ts/health/__tests__/health.service.test.d.ts.map +1 -0
  94. package/build/ts/health/__tests__/health.service.test.js +101 -0
  95. package/build/ts/health/__tests__/health.service.test.js.map +1 -0
  96. package/build/ts/health/health.controller.d.ts +16 -0
  97. package/build/ts/health/health.controller.d.ts.map +1 -0
  98. package/build/ts/health/health.controller.js +43 -0
  99. package/build/ts/health/health.controller.js.map +1 -0
  100. package/build/ts/health/health.module.d.ts +3 -0
  101. package/build/ts/health/health.module.d.ts.map +1 -0
  102. package/build/ts/health/health.module.js +22 -0
  103. package/build/ts/health/health.module.js.map +1 -0
  104. package/build/ts/health/health.service.d.ts +42 -0
  105. package/build/ts/health/health.service.d.ts.map +1 -0
  106. package/build/ts/health/health.service.js +176 -0
  107. package/build/ts/health/health.service.js.map +1 -0
  108. package/build/ts/health/types.d.ts +87 -0
  109. package/build/ts/health/types.d.ts.map +1 -0
  110. package/build/ts/health/types.js +2 -0
  111. package/build/ts/health/types.js.map +1 -0
  112. package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts +11 -0
  113. package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts.map +1 -0
  114. package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js +12 -0
  115. package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js.map +1 -0
  116. package/build/ts/proof/__tests__/proof.controller.test.js +8 -7
  117. package/build/ts/proof/__tests__/proof.controller.test.js.map +1 -1
  118. package/build/ts/proof/__tests__/proof.gateway.test.js +5 -3
  119. package/build/ts/proof/__tests__/proof.gateway.test.js.map +1 -1
  120. package/build/ts/proof/__tests__/proof.service.test.js +31 -75
  121. package/build/ts/proof/__tests__/proof.service.test.js.map +1 -1
  122. package/build/ts/proof/dto.d.ts +15 -18
  123. package/build/ts/proof/dto.d.ts.map +1 -1
  124. package/build/ts/proof/dto.js +55 -49
  125. package/build/ts/proof/dto.js.map +1 -1
  126. package/build/ts/proof/proof.controller.d.ts +3 -2
  127. package/build/ts/proof/proof.controller.d.ts.map +1 -1
  128. package/build/ts/proof/proof.controller.js +38 -15
  129. package/build/ts/proof/proof.controller.js.map +1 -1
  130. package/build/ts/proof/proof.module.d.ts.map +1 -1
  131. package/build/ts/proof/proof.module.js +1 -0
  132. package/build/ts/proof/proof.module.js.map +1 -1
  133. package/build/ts/proof/proof.service.d.ts +4 -6
  134. package/build/ts/proof/proof.service.d.ts.map +1 -1
  135. package/build/ts/proof/proof.service.js +48 -130
  136. package/build/ts/proof/proof.service.js.map +1 -1
  137. package/build/ts/proof/types.d.ts +21 -17
  138. package/build/ts/proof/types.d.ts.map +1 -1
  139. package/build/ts/proof/types.js.map +1 -1
  140. package/build/ts/redis/__tests__/redis.service.test.d.ts +2 -0
  141. package/build/ts/redis/__tests__/redis.service.test.d.ts.map +1 -0
  142. package/build/ts/redis/__tests__/redis.service.test.js +148 -0
  143. package/build/ts/redis/__tests__/redis.service.test.js.map +1 -0
  144. package/build/ts/redis/redis.module.d.ts +3 -0
  145. package/build/ts/redis/redis.module.d.ts.map +1 -0
  146. package/build/ts/redis/redis.module.js +18 -0
  147. package/build/ts/redis/redis.module.js.map +1 -0
  148. package/build/ts/redis/redis.service.d.ts +53 -0
  149. package/build/ts/redis/redis.service.d.ts.map +1 -0
  150. package/build/ts/redis/redis.service.js +99 -0
  151. package/build/ts/redis/redis.service.js.map +1 -0
  152. package/build/ts/redis/types.d.ts +66 -0
  153. package/build/ts/redis/types.d.ts.map +1 -0
  154. package/build/ts/redis/types.js +2 -0
  155. package/build/ts/redis/types.js.map +1 -0
  156. package/build/ts/redis/utils.d.ts +20 -0
  157. package/build/ts/redis/utils.d.ts.map +1 -0
  158. package/build/ts/redis/utils.js +27 -0
  159. package/build/ts/redis/utils.js.map +1 -0
  160. package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts +2 -0
  161. package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts.map +1 -0
  162. package/build/ts/scheduler/__tests__/scheduler.controller.test.js +62 -0
  163. package/build/ts/scheduler/__tests__/scheduler.controller.test.js.map +1 -0
  164. package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts +2 -0
  165. package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts.map +1 -0
  166. package/build/ts/scheduler/__tests__/scheduler.service.test.js +369 -0
  167. package/build/ts/scheduler/__tests__/scheduler.service.test.js.map +1 -0
  168. package/build/ts/scheduler/dto.d.ts +41 -0
  169. package/build/ts/scheduler/dto.d.ts.map +1 -0
  170. package/build/ts/scheduler/dto.js +115 -0
  171. package/build/ts/scheduler/dto.js.map +1 -0
  172. package/build/ts/scheduler/scheduler.controller.d.ts +32 -0
  173. package/build/ts/scheduler/scheduler.controller.d.ts.map +1 -0
  174. package/build/ts/scheduler/scheduler.controller.js +118 -0
  175. package/build/ts/scheduler/scheduler.controller.js.map +1 -0
  176. package/build/ts/scheduler/scheduler.module.d.ts +3 -0
  177. package/build/ts/scheduler/scheduler.module.d.ts.map +1 -0
  178. package/build/ts/scheduler/scheduler.module.js +24 -0
  179. package/build/ts/scheduler/scheduler.module.js.map +1 -0
  180. package/build/ts/scheduler/scheduler.service.d.ts +71 -0
  181. package/build/ts/scheduler/scheduler.service.d.ts.map +1 -0
  182. package/build/ts/scheduler/scheduler.service.js +297 -0
  183. package/build/ts/scheduler/scheduler.service.js.map +1 -0
  184. package/build/ts/scheduler/types.d.ts +65 -0
  185. package/build/ts/scheduler/types.d.ts.map +1 -0
  186. package/build/ts/scheduler/types.js +2 -0
  187. package/build/ts/scheduler/types.js.map +1 -0
  188. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js +2 -2
  189. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js.map +1 -1
  190. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js +34 -19
  191. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js.map +1 -1
  192. package/build/ts/sessionKeys/__tests__/utils.d.ts +1 -1
  193. package/build/ts/sessionKeys/__tests__/utils.d.ts.map +1 -1
  194. package/build/ts/sessionKeys/__tests__/utils.js +7 -6
  195. package/build/ts/sessionKeys/__tests__/utils.js.map +1 -1
  196. package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts +53 -0
  197. package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts.map +1 -0
  198. package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js +105 -0
  199. package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js.map +1 -0
  200. package/build/ts/sessionKeys/sessionKeys.service.d.ts +16 -4
  201. package/build/ts/sessionKeys/sessionKeys.service.d.ts.map +1 -1
  202. package/build/ts/sessionKeys/sessionKeys.service.js +23 -6
  203. package/build/ts/sessionKeys/sessionKeys.service.js.map +1 -1
  204. package/build/ts/subgraph/__tests__/subgraph.controller.test.js +3 -3
  205. package/build/ts/subgraph/__tests__/subgraph.controller.test.js.map +1 -1
  206. package/build/ts/subgraph/__tests__/subgraph.gateway.test.js +2 -2
  207. package/build/ts/subgraph/__tests__/subgraph.gateway.test.js.map +1 -1
  208. package/build/ts/subgraph/__tests__/subgraph.service.test.js +5 -5
  209. package/build/ts/subgraph/__tests__/subgraph.service.test.js.map +1 -1
  210. package/build/ts/subgraph/dto.d.ts +2 -2
  211. package/build/ts/subgraph/dto.d.ts.map +1 -1
  212. package/build/ts/subgraph/dto.js +3 -3
  213. package/build/ts/subgraph/dto.js.map +1 -1
  214. package/build/ts/subgraph/subgraph.controller.d.ts.map +1 -1
  215. package/build/ts/subgraph/subgraph.controller.js +8 -3
  216. package/build/ts/subgraph/subgraph.controller.js.map +1 -1
  217. package/build/ts/subgraph/subgraph.service.d.ts +4 -0
  218. package/build/ts/subgraph/subgraph.service.d.ts.map +1 -1
  219. package/build/ts/subgraph/subgraph.service.js +23 -10
  220. package/build/ts/subgraph/subgraph.service.js.map +1 -1
  221. package/build/ts/subgraph/types.d.ts +2 -2
  222. package/build/ts/subgraph/types.d.ts.map +1 -1
  223. package/build/tsconfig.build.tsbuildinfo +1 -1
  224. package/package.json +45 -38
  225. package/build/tests/e2e.aa.test.d.ts +0 -2
  226. package/build/tests/e2e.aa.test.d.ts.map +0 -1
  227. package/build/tests/e2e.aa.test.js +0 -103
  228. package/build/tests/e2e.aa.test.js.map +0 -1
  229. package/build/ts/deployer/utils.d.ts +0 -8
  230. package/build/ts/deployer/utils.d.ts.map +0 -1
  231. package/build/ts/deployer/utils.js +0 -9
  232. package/build/ts/deployer/utils.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maci-protocol/coordinator",
3
- "version": "0.0.0-ci.a577366",
3
+ "version": "0.0.0-ci.a73cfa9",
4
4
  "private": false,
5
5
  "description": "Coordinator service for MACI",
6
6
  "main": "build/ts/main.js",
@@ -22,64 +22,66 @@
22
22
  "run:node": "node --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(\"ts-node/esm\", pathToFileURL(\"./\"));'",
23
23
  "start": "pnpm run run:node ./ts/main.ts",
24
24
  "start:prod": "pnpm run run:node build/ts/main.js",
25
- "test": "jest --testPathIgnorePatterns=e2e.aa.test.ts --forceExit",
25
+ "test": "jest --testPathIgnorePatterns=tests/ --forceExit",
26
26
  "test:coverage": "jest --coverage --forceExit",
27
- "test:e2e": "jest --forceExit ./tests/e2e.aa.test.ts",
27
+ "test:e2e": "jest ./tests/*.test.ts --forceExit --runInBand",
28
28
  "types": "tsc -p tsconfig.json --noEmit",
29
29
  "generate-maci-keypair": "pnpm run run:node ./scripts/generateMaciKeypair.ts",
30
30
  "generate-keypair": "pnpm run run:node ./scripts/generateKeypair.ts",
31
31
  "get-auth-header": "pnpm run run:node ./scripts/getAuthHeader.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@graphprotocol/graph-cli": "^0.97.0",
35
- "@maci-protocol/crypto": "0.0.0-ci.a577366",
36
- "@maci-protocol/domainobjs": "0.0.0-ci.a577366",
37
- "@maci-protocol/sdk": "0.0.0-ci.a577366",
38
- "@maci-protocol/subgraph": "0.0.0-ci.a577366",
39
- "@nestjs/common": "^11.0.17",
40
- "@nestjs/core": "^11.0.17",
41
- "@nestjs/platform-express": "^11.0.13",
42
- "@nestjs/platform-socket.io": "^11.0.17",
43
- "@nestjs/swagger": "^11.1.1",
34
+ "@graphprotocol/graph-cli": "^0.97.1",
35
+ "@maci-protocol/contracts": "0.0.0-ci.a73cfa9",
36
+ "@maci-protocol/crypto": "0.0.0-ci.a73cfa9",
37
+ "@maci-protocol/domainobjs": "0.0.0-ci.a73cfa9",
38
+ "@maci-protocol/sdk": "0.0.0-ci.a73cfa9",
39
+ "@maci-protocol/subgraph": "0.0.0-ci.a73cfa9",
40
+ "@nestjs/common": "^11.1.5",
41
+ "@nestjs/core": "^11.1.5",
42
+ "@nestjs/platform-express": "^11.1.6",
43
+ "@nestjs/platform-socket.io": "^11.1.6",
44
+ "@nestjs/schedule": "^6.0.0",
45
+ "@nestjs/swagger": "^11.2.0",
44
46
  "@nestjs/throttler": "^6.4.0",
45
- "@nestjs/websockets": "^11.0.17",
46
- "@nomicfoundation/hardhat-ethers": "^3.0.8",
47
- "@nomicfoundation/hardhat-toolbox": "^5.0.0",
48
- "@zerodev/ecdsa-validator": "5.4.5",
49
- "@zerodev/permissions": "5.5.4",
50
- "@zerodev/sdk": "5.4.26",
47
+ "@nestjs/websockets": "^11.1.6",
48
+ "@nomicfoundation/hardhat-ethers": "^3.1.0",
49
+ "@nomicfoundation/hardhat-toolbox": "^6.1.0",
50
+ "@redis/client": "^5.8.2",
51
+ "@zerodev/ecdsa-validator": "5.4.9",
52
+ "@zerodev/permissions": "5.5.14",
53
+ "@zerodev/sdk": "5.4.41",
51
54
  "class-transformer": "^0.5.1",
52
- "class-validator": "^0.14.1",
55
+ "class-validator": "^0.14.2",
53
56
  "date-fns": "^4.1.0",
54
- "dotenv": "^16.4.7",
55
- "ethers": "^6.13.5",
56
- "hardhat": "^2.23.0",
57
+ "dotenv": "^17.2.0",
58
+ "ethers": "^6.15.0",
59
+ "hardhat": "^2.25.0",
57
60
  "helmet": "^8.1.0",
58
61
  "lowdb": "^1.0.0",
59
62
  "mustache": "^4.2.0",
60
- "permissionless": ">=0.1.18 <=0.1.29",
61
63
  "reflect-metadata": "^0.2.0",
62
64
  "rxjs": "^7.8.2",
63
65
  "socket.io": "^4.7.5",
64
66
  "tar": "^7.4.1",
65
67
  "ts-node": "^10.9.1",
66
- "viem": "^2.26.0"
68
+ "viem": "^2.33.2"
67
69
  },
68
70
  "devDependencies": {
69
- "@nestjs/cli": "^11.0.6",
70
- "@nestjs/schematics": "^11.0.4",
71
- "@nestjs/testing": "^11.0.17",
72
- "@types/express": "^5.0.1",
73
- "@types/jest": "^29.5.2",
71
+ "@nestjs/cli": "^11.0.10",
72
+ "@nestjs/schematics": "^11.0.7",
73
+ "@nestjs/testing": "^11.1.5",
74
+ "@types/express": "^5.0.3",
75
+ "@types/jest": "^30.0.0",
74
76
  "@types/lowdb": "^1.0.15",
75
- "@types/node": "^22.14.0",
77
+ "@types/node": "^24.2.0",
76
78
  "@types/supertest": "^6.0.2",
77
- "fast-check": "^4.1.1",
78
- "jest": "^29.5.0",
79
+ "fast-check": "^4.2.0",
80
+ "jest": "^30.0.4",
79
81
  "socket.io-client": "^4.7.5",
80
- "supertest": "^7.0.0",
81
- "ts-jest": "^29.3.0",
82
- "typescript": "^5.8.3"
82
+ "supertest": "^7.1.4",
83
+ "ts-jest": "^29.4.1",
84
+ "typescript": "^5.9.2"
83
85
  },
84
86
  "jest": {
85
87
  "testTimeout": 900000,
@@ -94,6 +96,9 @@
94
96
  "<rootDir>/tests"
95
97
  ],
96
98
  "testRegex": ".*\\.test\\.ts$",
99
+ "moduleNameMapper": {
100
+ "^@openzeppelin/merkle-tree$": "<rootDir>/ts/jest/__mocks__/@openzeppelin/merkle-tree.ts"
101
+ },
97
102
  "transform": {
98
103
  "^.+\\.js$": [
99
104
  "<rootDir>/ts/jest/transform.js",
@@ -112,13 +117,15 @@
112
117
  "**/*.(t|j)s",
113
118
  "!<rootDir>/ts/main.ts",
114
119
  "!<rootDir>/ts/jest/*.js",
120
+ "!<rootDir>/tests/*.ts",
115
121
  "!<rootDir>/hardhat.config.js"
116
122
  ],
117
123
  "coveragePathIgnorePatterns": [
118
- "<rootDir>/ts/sessionKeys/__tests__/utils.ts"
124
+ "<rootDir>/ts/sessionKeys/__tests__/utils.ts",
125
+ "<rootDir>/tests/*.ts"
119
126
  ],
120
127
  "coverageDirectory": "<rootDir>/coverage",
121
128
  "testEnvironment": "node"
122
129
  },
123
- "gitHead": "1cfa661921cd66314655e5ee707159dba59b5838"
130
+ "gitHead": "4ca4276356b3c29355acbc7062c063afa990de61"
124
131
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=e2e.aa.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"e2e.aa.test.d.ts","sourceRoot":"","sources":["../../tests/e2e.aa.test.ts"],"names":[],"mappings":""}
@@ -1,103 +0,0 @@
1
- import { zeroAddress } from "viem";
2
- import { ErrorCodes, ESupportedNetworks } from "../ts/common";
3
- import { CryptoService } from "../ts/crypto/crypto.service";
4
- import { testMaciDeploymentConfig, testPollDeploymentConfig } from "../ts/deployer/__tests__/utils";
5
- import { DeployerService } from "../ts/deployer/deployer.service";
6
- import { FileService } from "../ts/file/file.service";
7
- import { ProofGeneratorService } from "../ts/proof/proof.service";
8
- import { ENTRY_POINT, generateApproval, KERNEL_VERSION } from "../ts/sessionKeys/__tests__/utils";
9
- import { SessionKeysService } from "../ts/sessionKeys/sessionKeys.service";
10
- describe("E2E Account Abstraction Tests", () => {
11
- const fileService = new FileService();
12
- const sessionKeyService = new SessionKeysService(fileService);
13
- const cryptoService = new CryptoService();
14
- const proofService = new ProofGeneratorService(cryptoService, fileService, sessionKeyService);
15
- const deployerService = new DeployerService(sessionKeyService, fileService);
16
- // using an already deployed maci contract
17
- const maciContract = "0xf281870519822f302B13c07252d0f6A71E8D023e";
18
- const pollId = 2;
19
- let approval;
20
- let sessionKeyAddress;
21
- beforeAll(async () => {
22
- approval = await generateApproval(sessionKeyAddress);
23
- sessionKeyAddress = (await sessionKeyService.generateSessionKey()).sessionKeyAddress;
24
- });
25
- describe("deploy", () => {
26
- describe("deployMaci", () => {
27
- it("should deploy all maci related contracts", async () => {
28
- const { address: maciAddress } = await deployerService.deployMaci({
29
- approval,
30
- sessionKeyAddress,
31
- chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
32
- config: testMaciDeploymentConfig,
33
- });
34
- expect(maciAddress).not.toBe(zeroAddress);
35
- });
36
- });
37
- describe("deployPoll", () => {
38
- it("should deploy a poll", async () => {
39
- // Serialize the config with the custom serializer
40
- const serializedConfig = JSON.stringify(testPollDeploymentConfig);
41
- const pollConfig = JSON.parse(serializedConfig);
42
- const { pollId: poll } = await deployerService.deployPoll({
43
- approval,
44
- sessionKeyAddress,
45
- chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
46
- config: pollConfig,
47
- });
48
- expect(poll).toBeDefined();
49
- });
50
- });
51
- });
52
- describe("merge", () => {
53
- test("should return true when there are no errors", async () => {
54
- const { sessionKeyAddress: sessionKey } = await sessionKeyService.generateSessionKey();
55
- const generatedApproval = await generateApproval(sessionKey);
56
- const merged = await proofService.merge({
57
- maciContractAddress: maciContract,
58
- pollId,
59
- sessionKeyAddress: sessionKey,
60
- approval: generatedApproval,
61
- chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
62
- });
63
- expect(merged).toBe(true);
64
- });
65
- test("should throw when given an invalid pollId", async () => {
66
- const { sessionKeyAddress: sessionKey } = await sessionKeyService.generateSessionKey();
67
- const generatedApproval = await generateApproval(sessionKey);
68
- await expect(proofService.merge({
69
- maciContractAddress: maciContract,
70
- pollId: 50000,
71
- sessionKeyAddress: sessionKey,
72
- approval: generatedApproval,
73
- chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
74
- })).rejects.toThrow(ErrorCodes.POLL_NOT_FOUND.toString());
75
- });
76
- });
77
- describe("sessionKeys", () => {
78
- it("should create a client from a session key and an approval", async () => {
79
- const client = await sessionKeyService.generateClientFromSessionKey(sessionKeyAddress, approval, ESupportedNetworks.OPTIMISM_SEPOLIA);
80
- expect(client).toBeDefined();
81
- expect(client.transport.key).toBe("http");
82
- expect(client.key).toBe("Account");
83
- expect(client.account.address).not.toBe(zeroAddress);
84
- expect(client.account.kernelVersion).toBe(KERNEL_VERSION);
85
- expect(client.account.entryPoint).toBe(ENTRY_POINT);
86
- // this is an account with limited permissions so no sudo validator
87
- expect(client.account.kernelPluginManager.address).toBe(zeroAddress);
88
- expect(client.account.kernelPluginManager.sudoValidator).toBe(undefined);
89
- // send a transaction
90
- const tx = await client.sendTransaction({
91
- to: zeroAddress,
92
- value: 0n,
93
- data: "0x",
94
- });
95
- expect(tx.length).toBeGreaterThan(0);
96
- });
97
- it("should not allow to create a client after the session key has been deactivated", async () => {
98
- sessionKeyService.deactivateSessionKey(sessionKeyAddress);
99
- await expect(sessionKeyService.generateClientFromSessionKey(sessionKeyAddress, approval, ESupportedNetworks.OPTIMISM_SEPOLIA)).rejects.toThrow(ErrorCodes.SESSION_KEY_NOT_FOUND.toString());
100
- });
101
- });
102
- });
103
- //# sourceMappingURL=e2e.aa.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"e2e.aa.test.js","sourceRoot":"","sources":["../../tests/e2e.aa.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IACtC,MAAM,iBAAiB,GAAG,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC9D,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;IAC1C,MAAM,YAAY,GAAG,IAAI,qBAAqB,CAAC,aAAa,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC;IAC9F,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;IAE5E,0CAA0C;IAC1C,MAAM,YAAY,GAAG,4CAA4C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,EAAE,KAAK,IAAI,EAAE;YAC9F,iBAAiB,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;YAE1D,MAAM,MAAM,CACV,iBAAiB,CAAC,4BAA4B,CAC5C,iBAAiB,EACjB,QAAQ,EACR,kBAAkB,CAAC,gBAAgB,CACpC,CACF,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Estimate the extra gas limit
3
- *
4
- * @param callGasLimit The gas limit of the call
5
- * @returns The extra gas limit
6
- */
7
- export declare const estimateExtraGasLimit: (callGasLimit: bigint) => bigint;
8
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../ts/deployer/utils.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,cAAc,MAAM,KAAG,MACN,CAAC"}
@@ -1,9 +0,0 @@
1
- import { DIVISOR, EXTRA_GAS_LIMIT_PERCENTAGE } from "./constants";
2
- /**
3
- * Estimate the extra gas limit
4
- *
5
- * @param callGasLimit The gas limit of the call
6
- * @returns The extra gas limit
7
- */
8
- export const estimateExtraGasLimit = (callGasLimit) => (callGasLimit * EXTRA_GAS_LIMIT_PERCENTAGE) / DIVISOR;
9
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../ts/deployer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAElE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAoB,EAAU,EAAE,CACpE,CAAC,YAAY,GAAG,0BAA0B,CAAC,GAAG,OAAO,CAAC"}