@maci-protocol/coordinator 0.0.0-ci.4a1da43 → 0.0.0-ci.4bfa285
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 +31 -6
- 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/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 +127 -99
- 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 +11 -8
- package/build/ts/common/errors.d.ts.map +1 -1
- package/build/ts/common/errors.js +10 -7
- package/build/ts/common/errors.js.map +1 -1
- package/build/ts/common/index.d.ts +2 -1
- package/build/ts/common/index.d.ts.map +1 -1
- package/build/ts/common/index.js +2 -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 +2 -3
- 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 +181 -336
- 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 +46 -15
- package/build/ts/deployer/__tests__/utils.js.map +1 -1
- package/build/ts/deployer/deployer.service.d.ts +24 -51
- package/build/ts/deployer/deployer.service.d.ts.map +1 -1
- package/build/ts/deployer/deployer.service.js +334 -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 +78 -41
- 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 +6 -5
- 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 +27 -71
- 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 +1 -4
- 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 +111 -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 +2 -2
- 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.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/LICENSE
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
4
|
-
Cory Dickson, Han Jian, Chih-Cheng Liang, and Koh Wei Jie
|
|
3
|
+
Copyright (c) 2025 Ethereum Foundation
|
|
5
4
|
|
|
6
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -2,16 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
Please refer to [Offchain relayer service documentation](https://maci.pse.dev/docs/category/offchain-relayer) for more information.
|
|
4
4
|
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
1. [Node.js](https://nodejs.org/en) version 20.0.0.
|
|
8
|
+
2. [pnpm](https://pnpm.io/installation) package manager.
|
|
9
|
+
3. [rapidsnark](https://github.com/iden3/rapidsnark) program.
|
|
10
|
+
|
|
5
11
|
## Instructions
|
|
6
12
|
|
|
7
13
|
1. Add `.env` file (see `.env.example`).
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
4.
|
|
11
|
-
5.
|
|
12
|
-
6.
|
|
14
|
+
2. Remember to set up the rapidsnark file variable.
|
|
15
|
+
3. Generate RSA key pair with `pnpm run generate-keypair`.
|
|
16
|
+
4. Download zkey files using `pnpm run download-zkeys:{type}` (only test type is available for now).
|
|
17
|
+
5. Make sure you copied RSA public key to your application. This will be needed for encrypting `Authorization` header and coordinator private key for proof generation. Also it can be accessed through API method `GET v1/proof/publicKey`.
|
|
18
|
+
6. Run `pnpm run start` to run the service.
|
|
19
|
+
7. All API calls must be called with `Authorization` header, where the value is encrypted with RSA public key you generated before. Header value contains message signature and message digest created by `COORDINATOR_ADDRESSES`. The format is `publicEncrypt({signature}:{digest})`.
|
|
13
20
|
Make sure you set `COORDINATOR_ADDRESSES` env variable and sign any message with the addresses from your application (see [AccountSignatureGuard](./ts/auth/AccountSignatureGuard.service.ts)).
|
|
14
|
-
|
|
21
|
+
8. Proofs can be generated with `POST v1/proof/generate` API method or with Websockets (see [dto spec](./ts/proof/dto.ts), [controller](./ts/app.controller.ts) and [wsgateway](./ts/events/events.gateway.ts)).
|
|
15
22
|
|
|
16
23
|
## Subgraph deployment
|
|
17
24
|
|
|
@@ -40,3 +47,21 @@ After deployment, subgraph url will be available in studio dashboard and you can
|
|
|
40
47
|
```
|
|
41
48
|
https://api.studio.thegraph.com/.../{SUBGRAPH_NAME}/version/latest
|
|
42
49
|
```
|
|
50
|
+
|
|
51
|
+
## Docker
|
|
52
|
+
|
|
53
|
+
Remember to run it from the monorepo root directory.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Build docker
|
|
57
|
+
docker compose -f apps/coordinator/docker-compose.yml build
|
|
58
|
+
|
|
59
|
+
# Run container detached
|
|
60
|
+
docker compose -f apps/coordinator/docker-compose.yml up -d
|
|
61
|
+
|
|
62
|
+
# Enter the container
|
|
63
|
+
docker compose -f apps/coordinator/docker-compose.yml exec coordinator-service /bin/sh
|
|
64
|
+
|
|
65
|
+
# Stop container
|
|
66
|
+
docker compose -f apps/coordinator/docker-compose.yml down
|
|
67
|
+
```
|
package/build/hardhat.config.cjs
CHANGED
|
@@ -7,9 +7,9 @@ dotenv.config();
|
|
|
7
7
|
const parentDir = __dirname.includes("build") ? ".." : "";
|
|
8
8
|
const TEST_MNEMONIC = "test test test test test test test test test test test junk";
|
|
9
9
|
module.exports = {
|
|
10
|
-
defaultNetwork: "
|
|
10
|
+
defaultNetwork: "localhost",
|
|
11
11
|
networks: {
|
|
12
|
-
|
|
12
|
+
localhost: {
|
|
13
13
|
url: process.env.COORDINATOR_RPC_URL || "http://localhost:8545",
|
|
14
14
|
accounts: {
|
|
15
15
|
mnemonic: TEST_MNEMONIC,
|
|
@@ -17,12 +17,18 @@ module.exports = {
|
|
|
17
17
|
initialIndex: 0,
|
|
18
18
|
count: 20,
|
|
19
19
|
},
|
|
20
|
-
loggingEnabled: false,
|
|
21
20
|
},
|
|
22
21
|
hardhat: {
|
|
23
22
|
loggingEnabled: false,
|
|
23
|
+
mining: {
|
|
24
|
+
auto: true,
|
|
25
|
+
interval: 200,
|
|
26
|
+
},
|
|
24
27
|
},
|
|
25
28
|
},
|
|
29
|
+
solidity: {
|
|
30
|
+
version: "0.8.28",
|
|
31
|
+
},
|
|
26
32
|
paths: {
|
|
27
33
|
sources: path.resolve(__dirname, parentDir, "./node_modules/@maci-protocol/sdk/node_modules/@maci-protocol/contracts/contracts"),
|
|
28
34
|
artifacts: path.resolve(__dirname, parentDir, "./node_modules/@maci-protocol/sdk/node_modules/@maci-protocol/contracts/artifacts"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardhat.config.cjs","sourceRoot":"","sources":["../hardhat.config.cjs"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEjC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7B,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1D,MAAM,aAAa,GAAG,6DAA6D,CAAC;AAEpF,MAAM,CAAC,OAAO,GAAG;IACf,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"hardhat.config.cjs","sourceRoot":"","sources":["../hardhat.config.cjs"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEjC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7B,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1D,MAAM,aAAa,GAAG,6DAA6D,CAAC;AAEpF,MAAM,CAAC,OAAO,GAAG;IACf,cAAc,EAAE,WAAW;IAC3B,QAAQ,EAAE;QACR,SAAS,EAAE;YACT,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,uBAAuB;YAC/D,QAAQ,EAAE;gBACR,QAAQ,EAAE,aAAa;gBACvB,IAAI,EAAE,gBAAgB;gBACtB,YAAY,EAAE,CAAC;gBACf,KAAK,EAAE,EAAE;aACV;SACF;QACD,OAAO,EAAE;YACP,cAAc,EAAE,KAAK;YACrB,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,GAAG;aACd;SACF;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,QAAQ;KAClB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,IAAI,CAAC,OAAO,CACnB,SAAS,EACT,SAAS,EACT,mFAAmF,CACpF;QACD,SAAS,EAAE,IAAI,CAAC,OAAO,CACrB,SAAS,EACT,SAAS,EACT,mFAAmF,CACpF;KACF;CACF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const TEST_MNEMONIC: "test test test test test test test test test test test junk";
|
|
2
2
|
export let defaultNetwork: string;
|
|
3
3
|
export namespace networks {
|
|
4
|
-
namespace
|
|
4
|
+
namespace localhost {
|
|
5
5
|
let url: string;
|
|
6
6
|
namespace accounts {
|
|
7
7
|
export { TEST_MNEMONIC as mnemonic };
|
|
@@ -9,13 +9,18 @@ export namespace networks {
|
|
|
9
9
|
export let initialIndex: number;
|
|
10
10
|
export let count: number;
|
|
11
11
|
}
|
|
12
|
-
let loggingEnabled: boolean;
|
|
13
12
|
}
|
|
14
13
|
namespace hardhat {
|
|
15
|
-
let
|
|
16
|
-
|
|
14
|
+
let loggingEnabled: boolean;
|
|
15
|
+
namespace mining {
|
|
16
|
+
let auto: boolean;
|
|
17
|
+
let interval: number;
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
}
|
|
21
|
+
export namespace solidity {
|
|
22
|
+
let version: string;
|
|
23
|
+
}
|
|
19
24
|
export namespace paths {
|
|
20
25
|
let sources: string;
|
|
21
26
|
let artifacts: string;
|
|
@@ -17,8 +17,8 @@ export async function generateRsaKeypair() {
|
|
|
17
17
|
const publicKey = keypair.publicKey.export({ type: "pkcs1", format: "pem" });
|
|
18
18
|
const privateKey = keypair.privateKey.export({ type: "pkcs1", format: "pem" });
|
|
19
19
|
await Promise.all([
|
|
20
|
-
fs.promises.writeFile(path.resolve(process.env.COORDINATOR_PUBLIC_KEY_PATH), publicKey),
|
|
21
|
-
fs.promises.writeFile(path.resolve(process.env.COORDINATOR_PRIVATE_KEY_PATH), privateKey),
|
|
20
|
+
fs.promises.writeFile(path.resolve(process.env.COORDINATOR_PUBLIC_KEY_PATH || "./public.key"), publicKey),
|
|
21
|
+
fs.promises.writeFile(path.resolve(process.env.COORDINATOR_PRIVATE_KEY_PATH || "./private.key"), privateKey),
|
|
22
22
|
]);
|
|
23
23
|
}
|
|
24
24
|
generateRsaKeypair();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateKeypair.js","sourceRoot":"","sources":["../../scripts/generateKeypair.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,yCAAyC;AACzC,iDAAiD;AACjD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACn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D,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC;AAE1G,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,EAAE;QACzC,aAAa,EAAE,cAAc;KAC9B,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAE/E,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,cAAc,CAAC,EAAE,SAAS,CAAC;QACzG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,eAAe,CAAC,EAAE,UAAU,CAAC;KAC7G,CAAC,CAAC;AACL,CAAC;AAED,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export declare const pollJoiningTestZkeyPath
|
|
2
|
-
export declare const testPollJoiningWasmPath
|
|
3
|
-
export declare const testPollJoiningWitnessPath
|
|
1
|
+
export declare const pollJoiningTestZkeyPath: string;
|
|
2
|
+
export declare const testPollJoiningWasmPath: string;
|
|
3
|
+
export declare const testPollJoiningWitnessPath: string;
|
|
4
4
|
export declare const testRapidsnarkPath: string;
|
|
5
5
|
export declare const zeroUint256Encoded: string;
|
|
6
6
|
export declare const oneUint256Encoded: string;
|
|
7
|
-
export declare const pollDuration = 10;
|
|
8
7
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../tests/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../tests/constants.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,uBAAuB,QAA+E,CAAC;AACpH,eAAO,MAAM,uBAAuB,QAGnC,CAAC;AACF,eAAO,MAAM,0BAA0B,QAGtC,CAAC;AACF,eAAO,MAAM,kBAAkB,QAAyC,CAAC;AAEzE,eAAO,MAAM,kBAAkB,QAAsD,CAAC;AACtF,eAAO,MAAM,iBAAiB,QAAsD,CAAC"}
|
package/build/tests/constants.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AbiCoder } from "ethers";
|
|
2
2
|
import { homedir } from "os";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const
|
|
3
|
+
import path from "path";
|
|
4
|
+
const root = path.resolve(__dirname, "../../..");
|
|
5
|
+
export const pollJoiningTestZkeyPath = path.resolve(root, "./zkeys/PollJoining_10_test/PollJoining_10_test.0.zkey");
|
|
6
|
+
export const testPollJoiningWasmPath = path.resolve(root, "./zkeys/PollJoining_10_test/PollJoining_10_test_js/PollJoining_10_test.wasm");
|
|
7
|
+
export const testPollJoiningWitnessPath = path.resolve(root, "./zkeys/PollJoining_10_test/PollJoining_10_test_cpp/PollJoining_10_test");
|
|
6
8
|
export const testRapidsnarkPath = `${homedir()}/rapidsnark/build/prover`;
|
|
7
9
|
export const zeroUint256Encoded = AbiCoder.defaultAbiCoder().encode(["uint256"], [0]);
|
|
8
10
|
export const oneUint256Encoded = AbiCoder.defaultAbiCoder().encode(["uint256"], [1]);
|
|
9
|
-
export const pollDuration = 10; // 100 seconds (added to unix timestamp of start date)
|
|
10
11
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../tests/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../tests/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,wDAAwD,CAAC,CAAC;AACpH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,OAAO,CACjD,IAAI,EACJ,6EAA6E,CAC9E,CAAC;AACF,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,OAAO,CACpD,IAAI,EACJ,yEAAyE,CAC1E,CAAC;AACF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,OAAO,EAAE,0BAA0B,CAAC;AAEzE,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,59 +1,56 @@
|
|
|
1
|
-
// To only run this file: pnpm exec jest --testPathPattern=tests/e2e.deploy.test.ts
|
|
2
|
-
import { generateRandomSalt } from "@maci-protocol/crypto";
|
|
3
1
|
import { Keypair } from "@maci-protocol/domainobjs";
|
|
4
|
-
import {
|
|
2
|
+
import { isArm, joinPoll, signup, sleepUntil, ESupportedChains, ContractStorage } from "@maci-protocol/sdk";
|
|
5
3
|
import { ValidationPipe } from "@nestjs/common";
|
|
6
4
|
import { Test } from "@nestjs/testing";
|
|
7
5
|
import dotenv from "dotenv";
|
|
8
|
-
import hardhat from "hardhat";
|
|
9
6
|
import { io } from "socket.io-client";
|
|
10
7
|
import { zeroAddress } from "viem";
|
|
8
|
+
import path from "path";
|
|
11
9
|
import { AppModule } from "../ts/app.module";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { getSigner } from "../ts/common";
|
|
11
|
+
import { pollDuration, pollStartDateExtraSeconds, testMaciDeploymentConfig, testPollDeploymentConfig, } from "../ts/deployer/__tests__/utils";
|
|
12
|
+
import { DeployerModule } from "../ts/deployer/deployer.module";
|
|
15
13
|
import { FileModule } from "../ts/file/file.module";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
14
|
+
import { ProofModule } from "../ts/proof/proof.module";
|
|
15
|
+
import { SessionKeysModule } from "../ts/sessionKeys/sessionKeys.module";
|
|
16
|
+
import { pollJoiningTestZkeyPath, testPollJoiningWasmPath, testPollJoiningWitnessPath, testRapidsnarkPath, zeroUint256Encoded, } from "./constants";
|
|
17
|
+
import { getAuthorizationHeader } from "./utils";
|
|
19
18
|
dotenv.config();
|
|
20
|
-
|
|
19
|
+
jest.setTimeout(700000); // Sets timeout to 700 seconds
|
|
20
|
+
const PORT = process.env.COORDINATOR_PORT || 3000;
|
|
21
|
+
const TEST_URL = `http://localhost:${PORT}/v1`;
|
|
22
|
+
const CHAIN = ESupportedChains.Localhost;
|
|
23
|
+
const REGEX_SUBGRAPH = /^https:\/\/api\.studio\.thegraph\.com\/query\/\d+\/maci-subgraph\/v0\.0\.\d+$/;
|
|
21
24
|
const NUM_USERS = 1;
|
|
22
|
-
const
|
|
25
|
+
const VOTE_OPTIONS = {
|
|
23
26
|
"0": 0,
|
|
24
27
|
"1": 0,
|
|
25
28
|
};
|
|
26
29
|
describe("E2E Deployment Tests", () => {
|
|
27
30
|
let signer;
|
|
28
31
|
let encryptedHeader;
|
|
29
|
-
let coordinatorKeypair;
|
|
30
|
-
let sessionKeyAddress;
|
|
31
|
-
let approval;
|
|
32
32
|
let app;
|
|
33
33
|
let socket;
|
|
34
|
-
const publicClient = getPublicClient(ESupportedNetworks.OPTIMISM_SEPOLIA);
|
|
35
34
|
let maciAddress;
|
|
35
|
+
let maciCreatedAt;
|
|
36
36
|
let pollId;
|
|
37
37
|
// set up coordinator address
|
|
38
38
|
beforeAll(async () => {
|
|
39
|
-
|
|
39
|
+
signer = await getSigner(CHAIN);
|
|
40
40
|
encryptedHeader = await getAuthorizationHeader(signer);
|
|
41
|
-
coordinatorKeypair = new Keypair();
|
|
42
41
|
process.env.COORDINATOR_ADDRESSES = await signer.getAddress();
|
|
43
|
-
await rechargeGasIfNeeded(process.env.COORDINATOR_ADDRESSES, "0.007", "0.007");
|
|
44
|
-
});
|
|
45
|
-
// set up NestJS app
|
|
46
|
-
beforeAll(async () => {
|
|
47
42
|
const moduleFixture = await Test.createTestingModule({
|
|
48
|
-
imports: [AppModule, FileModule],
|
|
43
|
+
imports: [AppModule, FileModule, DeployerModule, ProofModule, SessionKeysModule],
|
|
49
44
|
}).compile();
|
|
50
45
|
app = moduleFixture.createNestApplication();
|
|
51
46
|
app.useGlobalPipes(new ValidationPipe({ transform: true }));
|
|
52
47
|
await app.init();
|
|
53
|
-
await app.listen(
|
|
48
|
+
await app.listen(PORT);
|
|
54
49
|
});
|
|
55
50
|
afterAll(async () => {
|
|
56
51
|
await app.close();
|
|
52
|
+
const storageInstance = ContractStorage.getInstance(path.join(process.cwd(), "deployed-contracts.json"));
|
|
53
|
+
storageInstance.cleanup(CHAIN);
|
|
57
54
|
});
|
|
58
55
|
// set up auth header in WS connection
|
|
59
56
|
beforeEach(async () => {
|
|
@@ -74,9 +71,24 @@ describe("E2E Deployment Tests", () => {
|
|
|
74
71
|
afterEach(() => {
|
|
75
72
|
socket.disconnect();
|
|
76
73
|
});
|
|
77
|
-
|
|
74
|
+
test("should return true in the health check", async () => {
|
|
75
|
+
const response = await fetch(`${TEST_URL}/health/check`, { method: "GET" });
|
|
76
|
+
const body = (await response.json());
|
|
77
|
+
expect(response.status).toBe(200);
|
|
78
|
+
expect(body.rapidsnark.rapidsnarkIsExecutable).toBe(true);
|
|
79
|
+
expect(body.zkeysDirectory.zkeysDirectoryExists).toBe(true);
|
|
80
|
+
expect(body.coordinatorWalletFunds.fundsInNetworks[0].address).not.toBe(zeroAddress);
|
|
81
|
+
});
|
|
82
|
+
test("should retrieve RSA public key", async () => {
|
|
83
|
+
const response = await fetch(`${TEST_URL}/proof/publicKey`, {
|
|
84
|
+
method: "GET",
|
|
85
|
+
});
|
|
86
|
+
const body = (await response.json());
|
|
87
|
+
expect(response.status).toBe(200);
|
|
88
|
+
expect(body.publicKey).toBeDefined();
|
|
89
|
+
});
|
|
78
90
|
test("should retrieve the session key address", async () => {
|
|
79
|
-
const response = await fetch(`${
|
|
91
|
+
const response = await fetch(`${TEST_URL}/session-keys/generate`, {
|
|
80
92
|
method: "GET",
|
|
81
93
|
headers: {
|
|
82
94
|
Authorization: encryptedHeader,
|
|
@@ -85,56 +97,41 @@ describe("E2E Deployment Tests", () => {
|
|
|
85
97
|
const body = (await response.json());
|
|
86
98
|
expect(response.status).toBe(200);
|
|
87
99
|
expect(body.sessionKeyAddress).not.toBe(zeroAddress);
|
|
88
|
-
// save them for next tests
|
|
89
|
-
sessionKeyAddress = body.sessionKeyAddress;
|
|
90
|
-
approval = await generateApproval(sessionKeyAddress);
|
|
91
|
-
const sessionKeyAccount = await getKernelAccount(sessionKeyAddress);
|
|
92
|
-
await rechargeGasIfNeeded(sessionKeyAccount.address, "0.03", "0.03");
|
|
93
100
|
});
|
|
94
101
|
test("should deploy MACI correctly", async () => {
|
|
95
|
-
const
|
|
96
|
-
config.VerifyingKeysRegistry.args.stateTreeDepth = config.VerifyingKeysRegistry.args.stateTreeDepth.toString();
|
|
97
|
-
config.VerifyingKeysRegistry.args.intStateTreeDepth =
|
|
98
|
-
config.VerifyingKeysRegistry.args.intStateTreeDepth.toString();
|
|
99
|
-
config.VerifyingKeysRegistry.args.voteOptionTreeDepth =
|
|
100
|
-
config.VerifyingKeysRegistry.args.voteOptionTreeDepth.toString();
|
|
101
|
-
const response = await fetch(`${LOCALHOST}/v1/deploy/maci`, {
|
|
102
|
+
const response = await fetch(`${TEST_URL}/deploy/maci`, {
|
|
102
103
|
method: "POST",
|
|
103
104
|
headers: {
|
|
104
105
|
Authorization: encryptedHeader,
|
|
105
106
|
"Content-Type": "application/json",
|
|
106
107
|
},
|
|
107
108
|
body: JSON.stringify({
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
|
|
111
|
-
config,
|
|
109
|
+
chain: CHAIN,
|
|
110
|
+
config: testMaciDeploymentConfig,
|
|
112
111
|
}),
|
|
113
112
|
});
|
|
114
113
|
const body = (await response.json());
|
|
115
114
|
expect(response.status).toBe(201);
|
|
116
115
|
expect(body.address).not.toBe(zeroAddress);
|
|
117
116
|
// save them for next tests
|
|
117
|
+
const blockNumber = await signer.provider.getBlockNumber();
|
|
118
|
+
maciCreatedAt = BigInt(blockNumber);
|
|
118
119
|
maciAddress = body.address;
|
|
119
120
|
});
|
|
120
121
|
test("should deploy a poll correctly", async () => {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
config.endDate = startDate + pollDuration;
|
|
127
|
-
const response = await fetch(`${LOCALHOST}/v1/deploy/poll`, {
|
|
122
|
+
testPollDeploymentConfig.voteOptions = testPollDeploymentConfig.voteOptions.toString();
|
|
123
|
+
const startDate = Math.floor(Date.now() / 1000) + pollStartDateExtraSeconds;
|
|
124
|
+
testPollDeploymentConfig.startDate = startDate;
|
|
125
|
+
testPollDeploymentConfig.endDate = startDate + pollDuration;
|
|
126
|
+
const response = await fetch(`${TEST_URL}/deploy/poll`, {
|
|
128
127
|
method: "POST",
|
|
129
128
|
headers: {
|
|
130
129
|
Authorization: encryptedHeader,
|
|
131
130
|
"Content-Type": "application/json",
|
|
132
131
|
},
|
|
133
132
|
body: JSON.stringify({
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
|
|
137
|
-
config,
|
|
133
|
+
chain: CHAIN,
|
|
134
|
+
config: testPollDeploymentConfig,
|
|
138
135
|
}),
|
|
139
136
|
});
|
|
140
137
|
const body = (await response.json());
|
|
@@ -143,36 +140,14 @@ describe("E2E Deployment Tests", () => {
|
|
|
143
140
|
// save them for next tests
|
|
144
141
|
pollId = BigInt(body.pollId);
|
|
145
142
|
});
|
|
146
|
-
test("should deploy a subgraph correctly", async () => {
|
|
147
|
-
const blockNumber = Number(await publicClient.getBlockNumber());
|
|
148
|
-
const response = await fetch(`${LOCALHOST}/v1/subgraph/deploy`, {
|
|
149
|
-
method: "POST",
|
|
150
|
-
headers: {
|
|
151
|
-
Authorization: encryptedHeader,
|
|
152
|
-
"Content-Type": "application/json",
|
|
153
|
-
},
|
|
154
|
-
body: JSON.stringify({
|
|
155
|
-
maciContractAddress: maciAddress,
|
|
156
|
-
startBlock: blockNumber,
|
|
157
|
-
network: ESupportedNetworks.OPTIMISM_SEPOLIA,
|
|
158
|
-
name: process.env.SUBGRAPH_NAME,
|
|
159
|
-
tag: `v0.0.${blockNumber}`, // different versions per test using block number
|
|
160
|
-
}),
|
|
161
|
-
});
|
|
162
|
-
const body = (await response.json());
|
|
163
|
-
const { url } = body;
|
|
164
|
-
const regex = /^https:\/\/api\.studio\.thegraph\.com\/query\/\d+\/maci-subgraph\/v0\.0\.\d+$/;
|
|
165
|
-
expect(response.status).toBe(201);
|
|
166
|
-
expect(body.url).toBeDefined();
|
|
167
|
-
expect(regex.test(url)).toBe(true);
|
|
168
|
-
});
|
|
169
143
|
test("should allow voting on a poll", async () => {
|
|
144
|
+
await sleepUntil(testPollDeploymentConfig.startDate * 1000);
|
|
170
145
|
for (let i = 0; i < NUM_USERS; i += 1) {
|
|
171
146
|
const keypairUser = new Keypair();
|
|
172
147
|
const userPublicKey = keypairUser.publicKey.serialize();
|
|
173
148
|
const userPrivateKey = keypairUser.privateKey.serialize();
|
|
174
149
|
const vote = i % 2;
|
|
175
|
-
|
|
150
|
+
VOTE_OPTIONS[String(vote)] += 1;
|
|
176
151
|
// user signs up to MACI
|
|
177
152
|
// eslint-disable-next-line no-await-in-loop
|
|
178
153
|
await signup({
|
|
@@ -186,37 +161,50 @@ describe("E2E Deployment Tests", () => {
|
|
|
186
161
|
await joinPoll({
|
|
187
162
|
maciAddress,
|
|
188
163
|
privateKey: userPrivateKey,
|
|
189
|
-
stateIndex: 1n,
|
|
190
164
|
pollId: BigInt(pollId),
|
|
191
165
|
pollJoiningZkey: pollJoiningTestZkeyPath,
|
|
192
166
|
useWasm: true,
|
|
193
167
|
pollWasm: testPollJoiningWasmPath,
|
|
194
|
-
|
|
168
|
+
pollWitnessGenerator: testPollJoiningWitnessPath,
|
|
195
169
|
rapidsnark: testRapidsnarkPath,
|
|
196
170
|
sgDataArg: zeroUint256Encoded,
|
|
197
171
|
ivcpDataArg: zeroUint256Encoded,
|
|
198
172
|
signer,
|
|
199
173
|
});
|
|
200
|
-
// user publishes a vote
|
|
201
|
-
// eslint-disable-next-line no-await-in-loop
|
|
202
|
-
const publishData = await publish({
|
|
203
|
-
publicKey: userPublicKey,
|
|
204
|
-
stateIndex: 1n,
|
|
205
|
-
voteOptionIndex: BigInt(vote),
|
|
206
|
-
nonce: 1n,
|
|
207
|
-
pollId: BigInt(pollId),
|
|
208
|
-
newVoteWeight: 1n,
|
|
209
|
-
maciAddress,
|
|
210
|
-
salt: generateRandomSalt(),
|
|
211
|
-
privateKey: userPrivateKey,
|
|
212
|
-
signer,
|
|
213
|
-
});
|
|
214
|
-
expect(publishData.hash).not.toBe(zeroAddress);
|
|
215
174
|
}
|
|
216
175
|
});
|
|
176
|
+
test("should deploy a subgraph correctly", async () => {
|
|
177
|
+
const response = await fetch(`${TEST_URL}/subgraph/deploy`, {
|
|
178
|
+
method: "POST",
|
|
179
|
+
headers: {
|
|
180
|
+
Authorization: encryptedHeader,
|
|
181
|
+
"Content-Type": "application/json",
|
|
182
|
+
},
|
|
183
|
+
body: JSON.stringify({
|
|
184
|
+
maciContractAddress: maciAddress,
|
|
185
|
+
startBlock: Number(maciCreatedAt),
|
|
186
|
+
network: ESupportedChains.OptimismSepolia,
|
|
187
|
+
name: process.env.SUBGRAPH_NAME,
|
|
188
|
+
tag: `v0.0.${maciCreatedAt}`, // different versions per test using block number
|
|
189
|
+
}),
|
|
190
|
+
});
|
|
191
|
+
const body = await response.json();
|
|
192
|
+
if (response.status === 400) {
|
|
193
|
+
const errorMessage = body.message;
|
|
194
|
+
if (errorMessage.includes("api.thegraph.com | 502: Bad gateway")) {
|
|
195
|
+
// eslint-disable-next-line no-console
|
|
196
|
+
console.info("It looks like there was a problem with The Graph endpoint. We are passing this test.");
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const { url } = body;
|
|
201
|
+
expect(response.status).toBe(201);
|
|
202
|
+
expect(url).toBeDefined();
|
|
203
|
+
expect(REGEX_SUBGRAPH.test(url)).toBe(true);
|
|
204
|
+
});
|
|
217
205
|
test("should merge correctly", async () => {
|
|
218
|
-
await
|
|
219
|
-
const response = await fetch(`${
|
|
206
|
+
await sleepUntil((testPollDeploymentConfig.endDate + 5) * 1000); // 5 seconds of grace time after the poll end date
|
|
207
|
+
const response = await fetch(`${TEST_URL}/proof/merge`, {
|
|
220
208
|
method: "POST",
|
|
221
209
|
headers: {
|
|
222
210
|
Authorization: encryptedHeader,
|
|
@@ -225,9 +213,49 @@ describe("E2E Deployment Tests", () => {
|
|
|
225
213
|
body: JSON.stringify({
|
|
226
214
|
maciContractAddress: maciAddress,
|
|
227
215
|
pollId: Number(pollId),
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
216
|
+
chain: CHAIN,
|
|
217
|
+
}),
|
|
218
|
+
});
|
|
219
|
+
expect(response.status).toBe(201);
|
|
220
|
+
});
|
|
221
|
+
test("should generate proofs correctly", async () => {
|
|
222
|
+
const useWasm = isArm(); // Use WASM on ARM devices, otherwise use rapidsnark
|
|
223
|
+
const response = await fetch(`${TEST_URL}/proof/generate`, {
|
|
224
|
+
method: "POST",
|
|
225
|
+
headers: {
|
|
226
|
+
Authorization: encryptedHeader,
|
|
227
|
+
"Content-Type": "application/json",
|
|
228
|
+
},
|
|
229
|
+
body: JSON.stringify({
|
|
230
|
+
poll: Number(pollId),
|
|
231
|
+
maciContractAddress: maciAddress,
|
|
232
|
+
mode: testPollDeploymentConfig.mode,
|
|
233
|
+
startBlock: Number(maciCreatedAt),
|
|
234
|
+
blocksPerBatch: 500,
|
|
235
|
+
chain: CHAIN,
|
|
236
|
+
useWasm,
|
|
237
|
+
}),
|
|
238
|
+
});
|
|
239
|
+
const body = (await response.json());
|
|
240
|
+
expect(response.status).toBe(201);
|
|
241
|
+
expect(body.processProofs).toBeDefined();
|
|
242
|
+
expect(body.processProofs.length).toBeGreaterThan(0);
|
|
243
|
+
expect(body.tallyProofs).toBeDefined();
|
|
244
|
+
expect(body.tallyProofs.length).toBeGreaterThan(0);
|
|
245
|
+
expect(body.tallyData).toBeDefined();
|
|
246
|
+
expect(body.tallyData.results).toBeDefined();
|
|
247
|
+
});
|
|
248
|
+
test("should submit results on-chain correctly", async () => {
|
|
249
|
+
const response = await fetch(`${TEST_URL}/proof/submit`, {
|
|
250
|
+
method: "POST",
|
|
251
|
+
headers: {
|
|
252
|
+
Authorization: encryptedHeader,
|
|
253
|
+
"Content-Type": "application/json",
|
|
254
|
+
},
|
|
255
|
+
body: JSON.stringify({
|
|
256
|
+
pollId: Number(pollId),
|
|
257
|
+
maciContractAddress: maciAddress,
|
|
258
|
+
chain: CHAIN,
|
|
231
259
|
}),
|
|
232
260
|
});
|
|
233
261
|
expect(response.status).toBe(201);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e.deploy.test.js","sourceRoot":"","sources":["../../tests/e2e.deploy.test.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"e2e.deploy.test.js","sourceRoot":"","sources":["../../tests/e2e.deploy.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC5G,OAAO,EAAE,cAAc,EAAyB,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAe,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAY,WAAW,EAAE,MAAM,MAAM,CAAC;AAE7C,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,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