@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.
- package/LICENSE +1 -2
- package/README.md +71 -10
- package/build/hardhat.config.cjs +9 -3
- package/build/hardhat.config.cjs.map +1 -1
- package/build/hardhat.config.d.cts +9 -4
- package/build/scripts/generateKeypair.js +2 -2
- package/build/scripts/generateKeypair.js.map +1 -1
- package/build/scripts/generateMaciKeyPair.js +2 -2
- package/build/scripts/generateMaciKeyPair.js.map +1 -1
- package/build/tests/constants.d.ts +3 -4
- package/build/tests/constants.d.ts.map +1 -1
- package/build/tests/constants.js +5 -4
- package/build/tests/constants.js.map +1 -1
- package/build/tests/e2e.deploy.test.js +132 -102
- package/build/tests/e2e.deploy.test.js.map +1 -1
- package/build/tests/e2e.redis.test.d.ts +2 -0
- package/build/tests/e2e.redis.test.d.ts.map +1 -0
- package/build/tests/e2e.redis.test.js +118 -0
- package/build/tests/e2e.redis.test.js.map +1 -0
- package/build/tests/utils.d.ts +7 -1
- package/build/tests/utils.d.ts.map +1 -1
- package/build/tests/utils.js +17 -6
- package/build/tests/utils.js.map +1 -1
- package/build/ts/app.module.d.ts.map +1 -1
- package/build/ts/app.module.js +6 -0
- package/build/ts/app.module.js.map +1 -1
- package/build/ts/common/__tests__/common.test.js +44 -46
- package/build/ts/common/__tests__/common.test.js.map +1 -1
- package/build/ts/common/accountAbstraction.d.ts +7 -24
- package/build/ts/common/accountAbstraction.d.ts.map +1 -1
- package/build/ts/common/accountAbstraction.js +22 -49
- package/build/ts/common/accountAbstraction.js.map +1 -1
- package/build/ts/common/chain.d.ts +22 -0
- package/build/ts/common/chain.d.ts.map +1 -0
- package/build/ts/common/chain.js +37 -0
- package/build/ts/common/chain.js.map +1 -0
- package/build/ts/common/coordinatorKeypair.d.ts +7 -0
- package/build/ts/common/coordinatorKeypair.d.ts.map +1 -0
- package/build/ts/common/coordinatorKeypair.js +14 -0
- package/build/ts/common/coordinatorKeypair.js.map +1 -0
- package/build/ts/common/errors.d.ts +13 -10
- package/build/ts/common/errors.d.ts.map +1 -1
- package/build/ts/common/errors.js +12 -9
- package/build/ts/common/errors.js.map +1 -1
- package/build/ts/common/http.d.ts +6 -0
- package/build/ts/common/http.d.ts.map +1 -0
- package/build/ts/common/http.js +49 -0
- package/build/ts/common/http.js.map +1 -0
- package/build/ts/common/index.d.ts +3 -1
- package/build/ts/common/index.d.ts.map +1 -1
- package/build/ts/common/index.js +3 -1
- package/build/ts/common/index.js.map +1 -1
- package/build/ts/common/networks.d.ts +2 -21
- package/build/ts/common/networks.d.ts.map +1 -1
- package/build/ts/common/networks.js +39 -48
- package/build/ts/common/networks.js.map +1 -1
- package/build/ts/common/types.d.ts +3 -4
- package/build/ts/common/types.d.ts.map +1 -1
- package/build/ts/deployer/__tests__/deployer.controller.test.js +23 -25
- package/build/ts/deployer/__tests__/deployer.controller.test.js.map +1 -1
- package/build/ts/deployer/__tests__/deployer.service.test.js +182 -337
- package/build/ts/deployer/__tests__/deployer.service.test.js.map +1 -1
- package/build/ts/deployer/__tests__/utils.d.ts +31 -6
- package/build/ts/deployer/__tests__/utils.d.ts.map +1 -1
- package/build/ts/deployer/__tests__/utils.js +47 -16
- package/build/ts/deployer/__tests__/utils.js.map +1 -1
- package/build/ts/deployer/deployer.controller.d.ts.map +1 -1
- package/build/ts/deployer/deployer.controller.js +19 -6
- package/build/ts/deployer/deployer.controller.js.map +1 -1
- package/build/ts/deployer/deployer.service.d.ts +26 -53
- package/build/ts/deployer/deployer.service.d.ts.map +1 -1
- package/build/ts/deployer/deployer.service.js +343 -468
- package/build/ts/deployer/deployer.service.js.map +1 -1
- package/build/ts/deployer/dto.d.ts +7 -7
- package/build/ts/deployer/dto.d.ts.map +1 -1
- package/build/ts/deployer/dto.js +14 -6
- package/build/ts/deployer/dto.js.map +1 -1
- package/build/ts/deployer/types.d.ts +83 -46
- package/build/ts/deployer/types.d.ts.map +1 -1
- package/build/ts/file/__tests__/file.service.test.js +12 -11
- package/build/ts/file/__tests__/file.service.test.js.map +1 -1
- package/build/ts/file/file.service.d.ts +4 -3
- package/build/ts/file/file.service.d.ts.map +1 -1
- package/build/ts/file/file.service.js +16 -10
- package/build/ts/file/file.service.js.map +1 -1
- package/build/ts/file/types.d.ts +2 -2
- package/build/ts/file/types.d.ts.map +1 -1
- package/build/ts/health/__tests__/health.controller.test.d.ts +2 -0
- package/build/ts/health/__tests__/health.controller.test.d.ts.map +1 -0
- package/build/ts/health/__tests__/health.controller.test.js +52 -0
- package/build/ts/health/__tests__/health.controller.test.js.map +1 -0
- package/build/ts/health/__tests__/health.service.test.d.ts +2 -0
- package/build/ts/health/__tests__/health.service.test.d.ts.map +1 -0
- package/build/ts/health/__tests__/health.service.test.js +101 -0
- package/build/ts/health/__tests__/health.service.test.js.map +1 -0
- package/build/ts/health/health.controller.d.ts +16 -0
- package/build/ts/health/health.controller.d.ts.map +1 -0
- package/build/ts/health/health.controller.js +43 -0
- package/build/ts/health/health.controller.js.map +1 -0
- package/build/ts/health/health.module.d.ts +3 -0
- package/build/ts/health/health.module.d.ts.map +1 -0
- package/build/ts/health/health.module.js +22 -0
- package/build/ts/health/health.module.js.map +1 -0
- package/build/ts/health/health.service.d.ts +42 -0
- package/build/ts/health/health.service.d.ts.map +1 -0
- package/build/ts/health/health.service.js +176 -0
- package/build/ts/health/health.service.js.map +1 -0
- package/build/ts/health/types.d.ts +87 -0
- package/build/ts/health/types.d.ts.map +1 -0
- package/build/ts/health/types.js +2 -0
- package/build/ts/health/types.js.map +1 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts +11 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts.map +1 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js +12 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js.map +1 -0
- package/build/ts/proof/__tests__/proof.controller.test.js +8 -7
- package/build/ts/proof/__tests__/proof.controller.test.js.map +1 -1
- package/build/ts/proof/__tests__/proof.gateway.test.js +5 -3
- package/build/ts/proof/__tests__/proof.gateway.test.js.map +1 -1
- package/build/ts/proof/__tests__/proof.service.test.js +31 -75
- package/build/ts/proof/__tests__/proof.service.test.js.map +1 -1
- package/build/ts/proof/dto.d.ts +15 -18
- package/build/ts/proof/dto.d.ts.map +1 -1
- package/build/ts/proof/dto.js +55 -49
- package/build/ts/proof/dto.js.map +1 -1
- package/build/ts/proof/proof.controller.d.ts +3 -2
- package/build/ts/proof/proof.controller.d.ts.map +1 -1
- package/build/ts/proof/proof.controller.js +38 -15
- package/build/ts/proof/proof.controller.js.map +1 -1
- package/build/ts/proof/proof.module.d.ts.map +1 -1
- package/build/ts/proof/proof.module.js +1 -0
- package/build/ts/proof/proof.module.js.map +1 -1
- package/build/ts/proof/proof.service.d.ts +4 -6
- package/build/ts/proof/proof.service.d.ts.map +1 -1
- package/build/ts/proof/proof.service.js +48 -130
- package/build/ts/proof/proof.service.js.map +1 -1
- package/build/ts/proof/types.d.ts +21 -17
- package/build/ts/proof/types.d.ts.map +1 -1
- package/build/ts/proof/types.js.map +1 -1
- package/build/ts/redis/__tests__/redis.service.test.d.ts +2 -0
- package/build/ts/redis/__tests__/redis.service.test.d.ts.map +1 -0
- package/build/ts/redis/__tests__/redis.service.test.js +148 -0
- package/build/ts/redis/__tests__/redis.service.test.js.map +1 -0
- package/build/ts/redis/redis.module.d.ts +3 -0
- package/build/ts/redis/redis.module.d.ts.map +1 -0
- package/build/ts/redis/redis.module.js +18 -0
- package/build/ts/redis/redis.module.js.map +1 -0
- package/build/ts/redis/redis.service.d.ts +53 -0
- package/build/ts/redis/redis.service.d.ts.map +1 -0
- package/build/ts/redis/redis.service.js +99 -0
- package/build/ts/redis/redis.service.js.map +1 -0
- package/build/ts/redis/types.d.ts +66 -0
- package/build/ts/redis/types.d.ts.map +1 -0
- package/build/ts/redis/types.js +2 -0
- package/build/ts/redis/types.js.map +1 -0
- package/build/ts/redis/utils.d.ts +20 -0
- package/build/ts/redis/utils.d.ts.map +1 -0
- package/build/ts/redis/utils.js +27 -0
- package/build/ts/redis/utils.js.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts +2 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.js +62 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.js.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts +2 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.js +369 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.js.map +1 -0
- package/build/ts/scheduler/dto.d.ts +41 -0
- package/build/ts/scheduler/dto.d.ts.map +1 -0
- package/build/ts/scheduler/dto.js +115 -0
- package/build/ts/scheduler/dto.js.map +1 -0
- package/build/ts/scheduler/scheduler.controller.d.ts +32 -0
- package/build/ts/scheduler/scheduler.controller.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.controller.js +118 -0
- package/build/ts/scheduler/scheduler.controller.js.map +1 -0
- package/build/ts/scheduler/scheduler.module.d.ts +3 -0
- package/build/ts/scheduler/scheduler.module.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.module.js +24 -0
- package/build/ts/scheduler/scheduler.module.js.map +1 -0
- package/build/ts/scheduler/scheduler.service.d.ts +71 -0
- package/build/ts/scheduler/scheduler.service.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.service.js +297 -0
- package/build/ts/scheduler/scheduler.service.js.map +1 -0
- package/build/ts/scheduler/types.d.ts +65 -0
- package/build/ts/scheduler/types.d.ts.map +1 -0
- package/build/ts/scheduler/types.js +2 -0
- package/build/ts/scheduler/types.js.map +1 -0
- package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js +2 -2
- package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js.map +1 -1
- package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js +34 -19
- package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js.map +1 -1
- package/build/ts/sessionKeys/__tests__/utils.d.ts +1 -1
- package/build/ts/sessionKeys/__tests__/utils.d.ts.map +1 -1
- package/build/ts/sessionKeys/__tests__/utils.js +7 -6
- package/build/ts/sessionKeys/__tests__/utils.js.map +1 -1
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts +53 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts.map +1 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js +105 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js.map +1 -0
- package/build/ts/sessionKeys/sessionKeys.service.d.ts +16 -4
- package/build/ts/sessionKeys/sessionKeys.service.d.ts.map +1 -1
- package/build/ts/sessionKeys/sessionKeys.service.js +23 -6
- package/build/ts/sessionKeys/sessionKeys.service.js.map +1 -1
- package/build/ts/subgraph/__tests__/subgraph.controller.test.js +3 -3
- package/build/ts/subgraph/__tests__/subgraph.controller.test.js.map +1 -1
- package/build/ts/subgraph/__tests__/subgraph.gateway.test.js +2 -2
- package/build/ts/subgraph/__tests__/subgraph.gateway.test.js.map +1 -1
- package/build/ts/subgraph/__tests__/subgraph.service.test.js +5 -5
- package/build/ts/subgraph/__tests__/subgraph.service.test.js.map +1 -1
- package/build/ts/subgraph/dto.d.ts +2 -2
- package/build/ts/subgraph/dto.d.ts.map +1 -1
- package/build/ts/subgraph/dto.js +3 -3
- package/build/ts/subgraph/dto.js.map +1 -1
- package/build/ts/subgraph/subgraph.controller.d.ts.map +1 -1
- package/build/ts/subgraph/subgraph.controller.js +8 -3
- package/build/ts/subgraph/subgraph.controller.js.map +1 -1
- package/build/ts/subgraph/subgraph.service.d.ts +4 -0
- package/build/ts/subgraph/subgraph.service.d.ts.map +1 -1
- package/build/ts/subgraph/subgraph.service.js +23 -10
- package/build/ts/subgraph/subgraph.service.js.map +1 -1
- package/build/ts/subgraph/types.d.ts +2 -2
- package/build/ts/subgraph/types.d.ts.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +45 -38
- package/build/tests/e2e.aa.test.d.ts +0 -2
- package/build/tests/e2e.aa.test.d.ts.map +0 -1
- package/build/tests/e2e.aa.test.js +0 -103
- package/build/tests/e2e.aa.test.js.map +0 -1
- package/build/ts/deployer/utils.d.ts +0 -8
- package/build/ts/deployer/utils.d.ts.map +0 -1
- package/build/ts/deployer/utils.js +0 -9
- 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.
|
|
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=
|
|
25
|
+
"test": "jest --testPathIgnorePatterns=tests/ --forceExit",
|
|
26
26
|
"test:coverage": "jest --coverage --forceExit",
|
|
27
|
-
"test:e2e": "jest
|
|
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.
|
|
35
|
-
"@maci-protocol/
|
|
36
|
-
"@maci-protocol/
|
|
37
|
-
"@maci-protocol/
|
|
38
|
-
"@maci-protocol/
|
|
39
|
-
"@
|
|
40
|
-
"@nestjs/
|
|
41
|
-
"@nestjs/
|
|
42
|
-
"@nestjs/platform-
|
|
43
|
-
"@nestjs/
|
|
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.
|
|
46
|
-
"@nomicfoundation/hardhat-ethers": "^3.0
|
|
47
|
-
"@nomicfoundation/hardhat-toolbox": "^
|
|
48
|
-
"@
|
|
49
|
-
"@zerodev/
|
|
50
|
-
"@zerodev/
|
|
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.
|
|
55
|
+
"class-validator": "^0.14.2",
|
|
53
56
|
"date-fns": "^4.1.0",
|
|
54
|
-
"dotenv": "^
|
|
55
|
-
"ethers": "^6.
|
|
56
|
-
"hardhat": "^2.
|
|
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.
|
|
68
|
+
"viem": "^2.33.2"
|
|
67
69
|
},
|
|
68
70
|
"devDependencies": {
|
|
69
|
-
"@nestjs/cli": "^11.0.
|
|
70
|
-
"@nestjs/schematics": "^11.0.
|
|
71
|
-
"@nestjs/testing": "^11.
|
|
72
|
-
"@types/express": "^5.0.
|
|
73
|
-
"@types/jest": "^
|
|
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": "^
|
|
77
|
+
"@types/node": "^24.2.0",
|
|
76
78
|
"@types/supertest": "^6.0.2",
|
|
77
|
-
"fast-check": "^4.
|
|
78
|
-
"jest": "^
|
|
79
|
+
"fast-check": "^4.2.0",
|
|
80
|
+
"jest": "^30.0.4",
|
|
79
81
|
"socket.io-client": "^4.7.5",
|
|
80
|
-
"supertest": "^7.
|
|
81
|
-
"ts-jest": "^29.
|
|
82
|
-
"typescript": "^5.
|
|
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": "
|
|
130
|
+
"gitHead": "4ca4276356b3c29355acbc7062c063afa990de61"
|
|
124
131
|
}
|
|
@@ -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,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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"}
|