@maci-protocol/coordinator 0.0.0-ci.7fb1869 → 0.0.0-ci.80cbc33

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 (198) hide show
  1. package/README.md +4 -4
  2. package/build/hardhat.config.cjs +6 -3
  3. package/build/hardhat.config.cjs.map +1 -1
  4. package/build/hardhat.config.d.cts +6 -4
  5. package/build/scripts/generateKeypair.js +2 -2
  6. package/build/scripts/generateKeypair.js.map +1 -1
  7. package/build/tests/constants.d.ts +3 -3
  8. package/build/tests/constants.d.ts.map +1 -1
  9. package/build/tests/constants.js +5 -3
  10. package/build/tests/constants.js.map +1 -1
  11. package/build/tests/e2e.deploy.test.js +25 -40
  12. package/build/tests/e2e.deploy.test.js.map +1 -1
  13. package/build/tests/e2e.redis.test.d.ts +2 -0
  14. package/build/tests/e2e.redis.test.d.ts.map +1 -0
  15. package/build/tests/e2e.redis.test.js +118 -0
  16. package/build/tests/e2e.redis.test.js.map +1 -0
  17. package/build/tests/utils.d.ts +1 -1
  18. package/build/tests/utils.d.ts.map +1 -1
  19. package/build/tests/utils.js +5 -3
  20. package/build/tests/utils.js.map +1 -1
  21. package/build/ts/app.module.d.ts.map +1 -1
  22. package/build/ts/app.module.js +6 -0
  23. package/build/ts/app.module.js.map +1 -1
  24. package/build/ts/common/__tests__/common.test.js +40 -38
  25. package/build/ts/common/__tests__/common.test.js.map +1 -1
  26. package/build/ts/common/accountAbstraction.d.ts +5 -5
  27. package/build/ts/common/accountAbstraction.d.ts.map +1 -1
  28. package/build/ts/common/accountAbstraction.js +10 -8
  29. package/build/ts/common/accountAbstraction.js.map +1 -1
  30. package/build/ts/common/chain.d.ts +10 -4
  31. package/build/ts/common/chain.d.ts.map +1 -1
  32. package/build/ts/common/chain.js +15 -10
  33. package/build/ts/common/chain.js.map +1 -1
  34. package/build/ts/common/errors.d.ts +15 -11
  35. package/build/ts/common/errors.d.ts.map +1 -1
  36. package/build/ts/common/errors.js +15 -11
  37. package/build/ts/common/errors.js.map +1 -1
  38. package/build/ts/common/index.d.ts +0 -1
  39. package/build/ts/common/index.d.ts.map +1 -1
  40. package/build/ts/common/index.js +0 -1
  41. package/build/ts/common/index.js.map +1 -1
  42. package/build/ts/common/networks.d.ts +2 -21
  43. package/build/ts/common/networks.d.ts.map +1 -1
  44. package/build/ts/common/networks.js +39 -48
  45. package/build/ts/common/networks.js.map +1 -1
  46. package/build/ts/common/types.d.ts +2 -2
  47. package/build/ts/common/types.d.ts.map +1 -1
  48. package/build/ts/deployer/__tests__/deployer.controller.test.js +23 -25
  49. package/build/ts/deployer/__tests__/deployer.controller.test.js.map +1 -1
  50. package/build/ts/deployer/__tests__/deployer.service.test.js +184 -80
  51. package/build/ts/deployer/__tests__/deployer.service.test.js.map +1 -1
  52. package/build/ts/deployer/__tests__/utils.d.ts +8 -9
  53. package/build/ts/deployer/__tests__/utils.d.ts.map +1 -1
  54. package/build/ts/deployer/__tests__/utils.js +12 -10
  55. package/build/ts/deployer/__tests__/utils.js.map +1 -1
  56. package/build/ts/deployer/deployer.service.d.ts +17 -8
  57. package/build/ts/deployer/deployer.service.d.ts.map +1 -1
  58. package/build/ts/deployer/deployer.service.js +215 -54
  59. package/build/ts/deployer/deployer.service.js.map +1 -1
  60. package/build/ts/deployer/dto.d.ts +3 -3
  61. package/build/ts/deployer/dto.d.ts.map +1 -1
  62. package/build/ts/deployer/dto.js +5 -5
  63. package/build/ts/deployer/dto.js.map +1 -1
  64. package/build/ts/deployer/types.d.ts +37 -27
  65. package/build/ts/deployer/types.d.ts.map +1 -1
  66. package/build/ts/file/file.service.d.ts.map +1 -1
  67. package/build/ts/file/file.service.js +4 -3
  68. package/build/ts/file/file.service.js.map +1 -1
  69. package/build/ts/health/__tests__/health.controller.test.d.ts +2 -0
  70. package/build/ts/health/__tests__/health.controller.test.d.ts.map +1 -0
  71. package/build/ts/health/__tests__/health.controller.test.js +52 -0
  72. package/build/ts/health/__tests__/health.controller.test.js.map +1 -0
  73. package/build/ts/health/__tests__/health.service.test.d.ts +2 -0
  74. package/build/ts/health/__tests__/health.service.test.d.ts.map +1 -0
  75. package/build/ts/health/__tests__/health.service.test.js +101 -0
  76. package/build/ts/health/__tests__/health.service.test.js.map +1 -0
  77. package/build/ts/health/health.controller.d.ts +16 -0
  78. package/build/ts/health/health.controller.d.ts.map +1 -0
  79. package/build/ts/health/health.controller.js +43 -0
  80. package/build/ts/health/health.controller.js.map +1 -0
  81. package/build/ts/health/health.module.d.ts +3 -0
  82. package/build/ts/health/health.module.d.ts.map +1 -0
  83. package/build/ts/health/health.module.js +22 -0
  84. package/build/ts/health/health.module.js.map +1 -0
  85. package/build/ts/health/health.service.d.ts +42 -0
  86. package/build/ts/health/health.service.d.ts.map +1 -0
  87. package/build/ts/health/health.service.js +176 -0
  88. package/build/ts/health/health.service.js.map +1 -0
  89. package/build/ts/health/types.d.ts +87 -0
  90. package/build/ts/health/types.d.ts.map +1 -0
  91. package/build/ts/health/types.js +2 -0
  92. package/build/ts/health/types.js.map +1 -0
  93. package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts +11 -0
  94. package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts.map +1 -0
  95. package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js +12 -0
  96. package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js.map +1 -0
  97. package/build/ts/proof/__tests__/proof.controller.test.js +3 -4
  98. package/build/ts/proof/__tests__/proof.controller.test.js.map +1 -1
  99. package/build/ts/proof/__tests__/proof.gateway.test.js +2 -3
  100. package/build/ts/proof/__tests__/proof.gateway.test.js.map +1 -1
  101. package/build/ts/proof/__tests__/proof.service.test.js +24 -55
  102. package/build/ts/proof/__tests__/proof.service.test.js.map +1 -1
  103. package/build/ts/proof/dto.d.ts +4 -5
  104. package/build/ts/proof/dto.d.ts.map +1 -1
  105. package/build/ts/proof/dto.js +7 -8
  106. package/build/ts/proof/dto.js.map +1 -1
  107. package/build/ts/proof/proof.module.d.ts.map +1 -1
  108. package/build/ts/proof/proof.module.js +1 -0
  109. package/build/ts/proof/proof.module.js.map +1 -1
  110. package/build/ts/proof/proof.service.d.ts.map +1 -1
  111. package/build/ts/proof/proof.service.js.map +1 -1
  112. package/build/ts/proof/types.d.ts +4 -5
  113. package/build/ts/proof/types.d.ts.map +1 -1
  114. package/build/ts/proof/types.js.map +1 -1
  115. package/build/ts/redis/__tests__/redis.service.test.d.ts +2 -0
  116. package/build/ts/redis/__tests__/redis.service.test.d.ts.map +1 -0
  117. package/build/ts/redis/__tests__/redis.service.test.js +148 -0
  118. package/build/ts/redis/__tests__/redis.service.test.js.map +1 -0
  119. package/build/ts/redis/redis.module.d.ts +3 -0
  120. package/build/ts/redis/redis.module.d.ts.map +1 -0
  121. package/build/ts/redis/redis.module.js +18 -0
  122. package/build/ts/redis/redis.module.js.map +1 -0
  123. package/build/ts/redis/redis.service.d.ts +53 -0
  124. package/build/ts/redis/redis.service.d.ts.map +1 -0
  125. package/build/ts/redis/redis.service.js +99 -0
  126. package/build/ts/redis/redis.service.js.map +1 -0
  127. package/build/ts/redis/types.d.ts +66 -0
  128. package/build/ts/redis/types.d.ts.map +1 -0
  129. package/build/ts/redis/types.js +2 -0
  130. package/build/ts/redis/types.js.map +1 -0
  131. package/build/ts/redis/utils.d.ts +20 -0
  132. package/build/ts/redis/utils.d.ts.map +1 -0
  133. package/build/ts/redis/utils.js +27 -0
  134. package/build/ts/redis/utils.js.map +1 -0
  135. package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts +2 -0
  136. package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts.map +1 -0
  137. package/build/ts/scheduler/__tests__/scheduler.controller.test.js +62 -0
  138. package/build/ts/scheduler/__tests__/scheduler.controller.test.js.map +1 -0
  139. package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts +2 -0
  140. package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts.map +1 -0
  141. package/build/ts/scheduler/__tests__/scheduler.service.test.js +369 -0
  142. package/build/ts/scheduler/__tests__/scheduler.service.test.js.map +1 -0
  143. package/build/ts/scheduler/dto.d.ts +41 -0
  144. package/build/ts/scheduler/dto.d.ts.map +1 -0
  145. package/build/ts/scheduler/dto.js +115 -0
  146. package/build/ts/scheduler/dto.js.map +1 -0
  147. package/build/ts/scheduler/scheduler.controller.d.ts +32 -0
  148. package/build/ts/scheduler/scheduler.controller.d.ts.map +1 -0
  149. package/build/ts/scheduler/scheduler.controller.js +111 -0
  150. package/build/ts/scheduler/scheduler.controller.js.map +1 -0
  151. package/build/ts/scheduler/scheduler.module.d.ts +3 -0
  152. package/build/ts/scheduler/scheduler.module.d.ts.map +1 -0
  153. package/build/ts/scheduler/scheduler.module.js +24 -0
  154. package/build/ts/scheduler/scheduler.module.js.map +1 -0
  155. package/build/ts/scheduler/scheduler.service.d.ts +71 -0
  156. package/build/ts/scheduler/scheduler.service.d.ts.map +1 -0
  157. package/build/ts/scheduler/scheduler.service.js +297 -0
  158. package/build/ts/scheduler/scheduler.service.js.map +1 -0
  159. package/build/ts/scheduler/types.d.ts +65 -0
  160. package/build/ts/scheduler/types.d.ts.map +1 -0
  161. package/build/ts/scheduler/types.js +2 -0
  162. package/build/ts/scheduler/types.js.map +1 -0
  163. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js +2 -2
  164. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js.map +1 -1
  165. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js +34 -19
  166. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js.map +1 -1
  167. package/build/ts/sessionKeys/__tests__/utils.d.ts +1 -1
  168. package/build/ts/sessionKeys/__tests__/utils.d.ts.map +1 -1
  169. package/build/ts/sessionKeys/__tests__/utils.js +7 -6
  170. package/build/ts/sessionKeys/__tests__/utils.js.map +1 -1
  171. package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts +1 -1
  172. package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts.map +1 -1
  173. package/build/ts/sessionKeys/sessionKeys.service.d.ts +4 -3
  174. package/build/ts/sessionKeys/sessionKeys.service.d.ts.map +1 -1
  175. package/build/ts/sessionKeys/sessionKeys.service.js +1 -2
  176. package/build/ts/sessionKeys/sessionKeys.service.js.map +1 -1
  177. package/build/ts/subgraph/__tests__/subgraph.controller.test.js +2 -2
  178. package/build/ts/subgraph/__tests__/subgraph.controller.test.js.map +1 -1
  179. package/build/ts/subgraph/__tests__/subgraph.gateway.test.js +2 -2
  180. package/build/ts/subgraph/__tests__/subgraph.gateway.test.js.map +1 -1
  181. package/build/ts/subgraph/__tests__/subgraph.service.test.js +5 -5
  182. package/build/ts/subgraph/__tests__/subgraph.service.test.js.map +1 -1
  183. package/build/ts/subgraph/dto.d.ts +2 -2
  184. package/build/ts/subgraph/dto.d.ts.map +1 -1
  185. package/build/ts/subgraph/dto.js +3 -3
  186. package/build/ts/subgraph/dto.js.map +1 -1
  187. package/build/ts/subgraph/subgraph.service.d.ts +4 -0
  188. package/build/ts/subgraph/subgraph.service.d.ts.map +1 -1
  189. package/build/ts/subgraph/subgraph.service.js +23 -10
  190. package/build/ts/subgraph/subgraph.service.js.map +1 -1
  191. package/build/ts/subgraph/types.d.ts +2 -2
  192. package/build/ts/subgraph/types.d.ts.map +1 -1
  193. package/build/tsconfig.build.tsbuildinfo +1 -1
  194. package/package.json +39 -32
  195. package/build/tests/e2e.aa.test.d.ts +0 -2
  196. package/build/tests/e2e.aa.test.d.ts.map +0 -1
  197. package/build/tests/e2e.aa.test.js +0 -96
  198. package/build/tests/e2e.aa.test.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.7fb1869",
3
+ "version": "0.0.0-ci.80cbc33",
4
4
  "private": false,
5
5
  "description": "Coordinator service for MACI",
6
6
  "main": "build/ts/main.js",
@@ -22,7 +22,7 @@
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.deploy.test.ts --testPathIgnorePatterns=e2e.test.ts --forceExit",
25
+ "test": "jest --testPathIgnorePatterns=tests/ --forceExit",
26
26
  "test:coverage": "jest --coverage --forceExit",
27
27
  "test:e2e": "jest ./tests/*.test.ts --forceExit --runInBand",
28
28
  "types": "tsc -p tsconfig.json --noEmit",
@@ -32,29 +32,31 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@graphprotocol/graph-cli": "^0.97.1",
35
- "@maci-protocol/contracts": "0.0.0-ci.7fb1869",
36
- "@maci-protocol/crypto": "0.0.0-ci.7fb1869",
37
- "@maci-protocol/domainobjs": "0.0.0-ci.7fb1869",
38
- "@maci-protocol/sdk": "0.0.0-ci.7fb1869",
39
- "@maci-protocol/subgraph": "0.0.0-ci.7fb1869",
40
- "@nestjs/common": "^11.1.3",
41
- "@nestjs/core": "^11.1.3",
42
- "@nestjs/platform-express": "^11.1.3",
43
- "@nestjs/platform-socket.io": "^11.1.3",
35
+ "@maci-protocol/contracts": "0.0.0-ci.80cbc33",
36
+ "@maci-protocol/crypto": "0.0.0-ci.80cbc33",
37
+ "@maci-protocol/domainobjs": "0.0.0-ci.80cbc33",
38
+ "@maci-protocol/sdk": "0.0.0-ci.80cbc33",
39
+ "@maci-protocol/subgraph": "0.0.0-ci.80cbc33",
40
+ "@nestjs/common": "^11.1.5",
41
+ "@nestjs/core": "^11.1.5",
42
+ "@nestjs/platform-express": "^11.1.5",
43
+ "@nestjs/platform-socket.io": "^11.1.6",
44
+ "@nestjs/schedule": "^6.0.0",
44
45
  "@nestjs/swagger": "^11.2.0",
45
46
  "@nestjs/throttler": "^6.4.0",
46
- "@nestjs/websockets": "^11.1.3",
47
- "@nomicfoundation/hardhat-ethers": "^3.0.9",
48
- "@nomicfoundation/hardhat-toolbox": "^5.0.0",
47
+ "@nestjs/websockets": "^11.1.5",
48
+ "@nomicfoundation/hardhat-ethers": "^3.1.0",
49
+ "@nomicfoundation/hardhat-toolbox": "^6.1.0",
50
+ "@redis/client": "^5.6.0",
49
51
  "@zerodev/ecdsa-validator": "5.4.9",
50
- "@zerodev/permissions": "5.5.8",
51
- "@zerodev/sdk": "5.4.36",
52
+ "@zerodev/permissions": "5.5.14",
53
+ "@zerodev/sdk": "5.4.41",
52
54
  "class-transformer": "^0.5.1",
53
55
  "class-validator": "^0.14.2",
54
56
  "date-fns": "^4.1.0",
55
- "dotenv": "^16.5.0",
56
- "ethers": "^6.14.4",
57
- "hardhat": "^2.24.3",
57
+ "dotenv": "^17.2.0",
58
+ "ethers": "^6.15.0",
59
+ "hardhat": "^2.25.0",
58
60
  "helmet": "^8.1.0",
59
61
  "lowdb": "^1.0.0",
60
62
  "mustache": "^4.2.0",
@@ -63,23 +65,23 @@
63
65
  "socket.io": "^4.7.5",
64
66
  "tar": "^7.4.1",
65
67
  "ts-node": "^10.9.1",
66
- "viem": "^2.31.3"
68
+ "viem": "^2.33.2"
67
69
  },
68
70
  "devDependencies": {
69
- "@nestjs/cli": "^11.0.7",
70
- "@nestjs/schematics": "^11.0.5",
71
- "@nestjs/testing": "^11.1.3",
71
+ "@nestjs/cli": "^11.0.10",
72
+ "@nestjs/schematics": "^11.0.7",
73
+ "@nestjs/testing": "^11.1.5",
72
74
  "@types/express": "^5.0.3",
73
- "@types/jest": "^29.5.2",
75
+ "@types/jest": "^30.0.0",
74
76
  "@types/lowdb": "^1.0.15",
75
- "@types/node": "^24.0.1",
77
+ "@types/node": "^24.2.0",
76
78
  "@types/supertest": "^6.0.2",
77
- "fast-check": "^4.1.1",
78
- "jest": "^30.0.0",
79
+ "fast-check": "^4.2.0",
80
+ "jest": "^30.0.4",
79
81
  "socket.io-client": "^4.7.5",
80
- "supertest": "^7.1.1",
81
- "ts-jest": "^29.4.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": "0f72404b1f1e5b714ada9e5598dc2d0da5feade5"
130
+ "gitHead": "563583c06f916920e27686a736b5cc8958b177fe"
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,96 +0,0 @@
1
- import { sleep } from "@maci-protocol/sdk";
2
- import { zeroAddress } from "viem";
3
- import { ErrorCodes, ESupportedNetworks } from "../ts/common";
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 proofService = new ProofGeneratorService(fileService, sessionKeyService);
14
- const deployerService = new DeployerService(sessionKeyService, fileService);
15
- // using an already deployed maci contract
16
- let maciContract = "";
17
- let pollId;
18
- let approval;
19
- let sessionKeyAddress;
20
- beforeAll(async () => {
21
- sessionKeyAddress = (await sessionKeyService.generateSessionKey()).sessionKeyAddress;
22
- approval = await generateApproval(sessionKeyAddress);
23
- });
24
- describe("deploy", () => {
25
- describe("deployMaci", () => {
26
- it("should deploy all maci related contracts", async () => {
27
- const { address: maciAddress } = await deployerService.deployMaci({
28
- chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
29
- config: testMaciDeploymentConfig,
30
- });
31
- maciContract = maciAddress;
32
- expect(maciAddress).not.toBe(zeroAddress);
33
- });
34
- });
35
- describe("deployPoll", () => {
36
- it("should deploy a poll", async () => {
37
- const { pollId: poll } = await deployerService.deployPoll({
38
- chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
39
- config: {
40
- ...testPollDeploymentConfig,
41
- startDate: Math.floor(Date.now() / 1000) + 50,
42
- endDate: Math.floor(Date.now() / 1000) + 85,
43
- },
44
- });
45
- expect(poll).toBeDefined();
46
- pollId = Number.parseInt(poll, 10);
47
- });
48
- });
49
- });
50
- describe("merge", () => {
51
- test("should return true when there are no errors", async () => {
52
- // wait until we can complete a poll
53
- await sleep(90 * 1000); // 50 start + 35 end + 5 seconds of grace time
54
- const merged = await proofService.merge({
55
- maciContractAddress: maciContract,
56
- pollId,
57
- chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
58
- });
59
- expect(merged).toBe(true);
60
- });
61
- test("should throw when given an invalid pollId", async () => {
62
- const invalidPollId = 50000;
63
- await expect(proofService.merge({
64
- maciContractAddress: maciContract,
65
- pollId: invalidPollId,
66
- chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
67
- })).rejects.toThrow(`MACI contract doesn't have any deployed poll ${invalidPollId}`);
68
- });
69
- });
70
- describe("sessionKeys", () => {
71
- it("should create a client from a session key and an approval", async () => {
72
- const client = await sessionKeyService.generateClientFromSessionKey(sessionKeyAddress, approval, ESupportedNetworks.OPTIMISM_SEPOLIA);
73
- expect(client).toBeDefined();
74
- expect(client.transport.key).toBe("http");
75
- expect(client.key).toBe("Account");
76
- expect(client.account.address).not.toBe(zeroAddress);
77
- expect(client.account.kernelVersion).toBe(KERNEL_VERSION);
78
- expect(client.account.entryPoint.version).toBe(ENTRY_POINT.version);
79
- // this is an account with limited permissions so no sudo validator
80
- expect(client.account.kernelPluginManager.address).toBe(zeroAddress);
81
- expect(client.account.kernelPluginManager.sudoValidator).toBe(undefined);
82
- // send a transaction
83
- const tx = await client.sendTransaction({
84
- to: zeroAddress,
85
- value: 0n,
86
- data: "0x",
87
- });
88
- expect(tx.length).toBeGreaterThan(0);
89
- });
90
- it("should not allow to create a client after the session key has been deactivated", async () => {
91
- sessionKeyService.deactivateSessionKey(sessionKeyAddress);
92
- await expect(sessionKeyService.generateClientFromSessionKey(sessionKeyAddress, approval, ESupportedNetworks.OPTIMISM_SEPOLIA)).rejects.toThrow(ErrorCodes.SESSION_KEY_NOT_FOUND.toString());
93
- });
94
- });
95
- });
96
- //# 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,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAO,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,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