diff --git a/.gitignore b/.gitignore index 488f34c..e8a4b14 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules build generated yarn.lock -test/.bin +tests/.bin/* +tests/.latest.json subgraph.test.yaml test-stack/.env diff --git a/CHANGELOG.md b/CHANGELOG.md index 234e11a..9030d04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## vNEXT +- Remove unused files (#42) - Rewrite Jenkins CI for future migration (#36, #37) - Add a modern test stack, agnostic to the forked network. (#38) - Add a section in the README to explain how to use the Docker-based subgraph deployer. (#38) diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 2105939..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM node:22 -WORKDIR /iexec-poco-subgraph -COPY package*.json . -RUN npm ci -COPY schema.graphql . -COPY subgraph.yaml . -COPY networks.json . -COPY src src -ENTRYPOINT [ "npm", "run", "deploy:all" ] diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 87848d9..0000000 --- a/docker/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Containerized graphnodes - -## Prerequisites: - -- install **graph** cli: `npm i -g @graphprotocol/graph-cli` or alias the local install -- blockchain specific: - - for **viviani graphnodes**, a `viviani-archive-node` docker service must expose `8545` on network `viviani_blockchain` - - for **bellecour graphnodes**, a `bellecour-archive-node` docker service must expose `8545` on network `bellecour_blockchain` - -## Usage - -```sh -# choose target blockchain directory (ex: test) -cd test/ - -# start the graphnode with the dependencies -docker-compose up -d - -# deploy the subgraphs on the graphnode -./deploy-subgraph.sh -``` diff --git a/docker/all-chains/.env b/docker/all-chains/.env deleted file mode 100644 index 2d21846..0000000 --- a/docker/all-chains/.env +++ /dev/null @@ -1,4 +0,0 @@ -DATA=/home/tmp/graph-bellecour -DB_USER=graphnode -DB_PASSWORD=somerandompasswordthatishardtoguess -DB_NAME=graphnode diff --git a/docker/all-chains/deploy-subgraph.sh b/docker/all-chains/deploy-subgraph.sh deleted file mode 100755 index d43cdda..0000000 --- a/docker/all-chains/deploy-subgraph.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -cd ../.. - -# viviani -graph create viviani/poco --node http://127.0.0.1:13320 -graph deploy viviani/poco subgraph.viviani.yaml --node http://127.0.0.1:13320 --ipfs http://127.0.0.1:5001 --version-label 0.0.1 - -echo "browse viviani/poco subgraph at http://127.0.0.1:13300/subgraphs/name/viviani/poco/graphql" - -# bellecour -graph create bellecour/poco --node http://127.0.0.1:13420 -graph deploy bellecour/poco subgraph.bellecour.yaml --node http://127.0.0.1:13420 --ipfs http://127.0.0.1:5001 --version-label 0.0.1 - -echo "browse bellecour/poco subgraph at http://127.0.0.1:13400/subgraphs/name/bellecour/poco/graphql" diff --git a/docker/all-chains/docker-compose.yml b/docker/all-chains/docker-compose.yml deleted file mode 100644 index c6fcdfc..0000000 --- a/docker/all-chains/docker-compose.yml +++ /dev/null @@ -1,194 +0,0 @@ -version: "3" - -networks: - thegraph-bellecour: - bellecour: - external: - name: bellecour_blockchain - thegraph-viviani: - viviani: - external: - name: viviani_blockchain - thegraph-goerli: - -services: - ipfs: - image: ipfs/go-ipfs:v0.10.0 - restart: unless-stopped - networks: - - thegraph-bellecour - - thegraph-viviani - - thegraph-goerli - expose: - - 5001 - ports: - - 5001:5001 - volumes: - - ${DATA}/ipfs:/data/ipfs - - postgres-viviani: - image: postgres:12 - restart: unless-stopped - networks: - - thegraph-viviani - command: - - "postgres" - - "-cshared_preload_libraries=pg_stat_statements" - expose: - - 5432 - environment: - POSTGRES_USER: "${DB_USER}" - POSTGRES_PASSWORD: "${DB_PASSWORD}" - POSTGRES_DB: "${DB_NAME}" - volumes: - - ${DATA}/viviani/postgres:/var/lib/postgresql/data - - graphnode-viviani: - image: graphprotocol/graph-node:v0.27.0 - restart: unless-stopped - networks: - - viviani - - thegraph-viviani - depends_on: - - ipfs - - postgres-viviani - ports: - - 13300:8000 # http - - 13301:8001 # ws - - 13320:8020 # deploy - - 13330:8030 # monitoring - - 13340:8040 # prometeus - environment: - RUST_BACKTRACE: 1 - postgres_host: postgres-viviani - postgres_user: "${DB_USER}" - postgres_pass: "${DB_PASSWORD}" - postgres_db: "${DB_NAME}" - ipfs: "ipfs:5001" - ethereum: "viviani:http://viviani-archive-node:8545" - GRAPH_NODE_ID: "graphnode_id" - - postgres-bellecour: - image: postgres:12 - restart: unless-stopped - networks: - - thegraph-bellecour - command: - - "postgres" - - "-cshared_preload_libraries=pg_stat_statements" - expose: - - 5432 - environment: - POSTGRES_USER: "${DB_USER}" - POSTGRES_PASSWORD: "${DB_PASSWORD}" - POSTGRES_DB: "${DB_NAME}" - volumes: - - ${DATA}/bellecour/postgres:/var/lib/postgresql/data - - graphnode-bellecour: - image: graphprotocol/graph-node:v0.27.0 - restart: unless-stopped - networks: - - bellecour - - thegraph-bellecour - depends_on: - - ipfs - - postgres-bellecour - expose: - - 8000 - - 8001 - ports: - - 13400:8000 # http - - 13401:8001 # ws - - 13420:8020 # deploy - - 13430:8030 # monitoring - - 13440:8040 # prometeus - environment: - RUST_BACKTRACE: 1 - postgres_host: postgres-bellecour - postgres_user: "${DB_USER}" - postgres_pass: "${DB_PASSWORD}" - postgres_db: "${DB_NAME}" - ipfs: "ipfs:5001" - ethereum: "bellecour:http://bellecour-archive-node:8545" - GRAPH_NODE_ID: "graphnode_id" - # postgres-goerli: - # image: postgres:12 - # restart: unless-stopped - # networks: - # - thegraph-goerli - # command: - # - "postgres" - # - "-cshared_preload_libraries=pg_stat_statements" - # expose: - # - 5432 - # environment: - # POSTGRES_USER: "${DB_USER}" - # POSTGRES_PASSWORD: "${DB_PASSWORD}" - # POSTGRES_DB: "${DB_NAME}" - # volumes: - # - ${DATA}/goerli/postgres:/var/lib/postgresql/data - # graphnode-goerli: - # image: graphprotocol/graph-node:v0.27.0 - # restart: unless-stopped - # networks: - # - thegraph-goerli - # depends_on: - # - ipfs - # - postgres-goerli - # ports: - # - 50000:8000 # http - # - 50001:8001 # ws - # - 50020:8020 # deploy - # - 50030:8030 # monitoring - # - 50040:8040 # prometeus - # environment: - # RUST_BACKTRACE: 1 - # RUST_BACKTRACE: full - # postgres_host: postgres-goerli - # postgres_user: "${DB_USER}" - # postgres_pass: "${DB_PASSWORD}" - # postgres_db: "${DB_NAME}" - # ipfs: "ipfs:5001" - # ethereum: "goerli:https://eth-goerli.alchemyapi.io/v2/Up5Axu02IzUdyhpxbavUdSnU8cDcG8rT" - # GRAPH_NODE_ID: "graphnode_id" - # postgres-goerli-infura: - # image: postgres:12 - # restart: unless-stopped - # networks: - # - thegraph-goerli - # command: - # - "postgres" - # - "-cshared_preload_libraries=pg_stat_statements" - # expose: - # - 5432 - # environment: - # POSTGRES_USER: "${DB_USER}" - # POSTGRES_PASSWORD: "${DB_PASSWORD}" - # POSTGRES_DB: "${DB_NAME}" - # volumes: - # - ${DATA}/goerli-infura/postgres:/var/lib/postgresql/data - # graphnode-goerli-infura: - # image: graphprotocol/graph-node:v0.27.0 - # restart: unless-stopped - # networks: - # - thegraph-goerli - # depends_on: - # - ipfs - # - postgres-goerli-infura - # ports: - # - 51000:8000 # http - # - 51001:8001 # ws - # - 51020:8020 # deploy - # - 51030:8030 # monitoring - # - 51040:8040 # prometeus - # environment: - # RUST_BACKTRACE: 1 - # RUST_BACKTRACE: full - # postgres_host: postgres-goerli-infura - # postgres_user: "${DB_USER}" - # postgres_pass: "${DB_PASSWORD}" - # postgres_db: "${DB_NAME}" - # ipfs: "ipfs:5001" - # ethereum: "goerli:https://goerli.infura.io/v3/514947489c494970878e796545044fb2" - # GRAPH_NODE_ID: "graphnode_id" diff --git a/docker/bellecour/.env b/docker/bellecour/.env deleted file mode 100644 index 91d873b..0000000 --- a/docker/bellecour/.env +++ /dev/null @@ -1,4 +0,0 @@ -DATA=/home/tmp/graph-all-chains -DB_USER=graphnode -DB_PASSWORD=somerandompasswordthatishardtoguess -DB_BASE_NAME=graphnode diff --git a/docker/bellecour/deploy-subgraph.sh b/docker/bellecour/deploy-subgraph.sh deleted file mode 100755 index eb605e2..0000000 --- a/docker/bellecour/deploy-subgraph.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -cd ../.. - -# bellecour -graph create bellecour/poco --node http://127.0.0.1:8020 -graph deploy bellecour/poco subgraph.bellecour.yaml --node http://127.0.0.1:8020 --ipfs http://127.0.01:5001 --version-label 0.0.1 - -echo "browse bellecour/poco subgraph at http://127.0.0.1:8000/subgraphs/name/bellecour/poco/graphql" diff --git a/docker/bellecour/docker-compose.yml b/docker/bellecour/docker-compose.yml deleted file mode 100644 index 61b667b..0000000 --- a/docker/bellecour/docker-compose.yml +++ /dev/null @@ -1,62 +0,0 @@ -version: "3" - -networks: - thegraph: - blockchain: - external: - name: viviani_blockchain - -services: - ipfs: - image: ipfs/go-ipfs:v0.10.0 - restart: unless-stopped - networks: - - thegraph - expose: - - 5001 - ports: - - 5001:5001 - volumes: - - ${DATA}/ipfs:/data/ipfs - - postgres: - image: postgres:12 - restart: unless-stopped - networks: - - thegraph - command: - - "postgres" - - "-cshared_preload_libraries=pg_stat_statements" - expose: - - 5432 - environment: - POSTGRES_USER: "${DB_USER}" - POSTGRES_PASSWORD: "${DB_PASSWORD}" - POSTGRES_DB: "${DB_NAME}" - volumes: - - ${DATA}/postgres:/var/lib/postgresql/data - - graphnode: - image: graphprotocol/graph-node:v0.27.0 - restart: unless-stopped - networks: - - blockchain - - thegraph - depends_on: - - ipfs - - postgres - ports: - - 8000:8000 # http - - 8001:8001 # ws - - 8020:8020 # deploy - - 8030:8030 # monitoring - - 8040:8040 # prometeus - environment: - RUST_BACKTRACE: 1 - postgres_host: postgres - postgres_user: "${DB_USER}" - postgres_pass: "${DB_PASSWORD}" - postgres_db: "${DB_NAME}" - ipfs: "ipfs:5001" - ethereum: "bellecour:http://bellecour-archive-node:8545" - GRAPH_NODE_ID: "graphnode_id" diff --git a/docker/test/.env b/docker/test/.env deleted file mode 100644 index 7649d92..0000000 --- a/docker/test/.env +++ /dev/null @@ -1,5 +0,0 @@ -DATA=/home/tmp/graph-test -DB_USER=graphnode -DB_PASSWORD=somerandompasswordthatishardtoguess -DB_NAME=graphnode-db -NETWORK_NAME=test diff --git a/docker/test/deploy-subgraph.sh b/docker/test/deploy-subgraph.sh deleted file mode 100755 index a2a538f..0000000 --- a/docker/test/deploy-subgraph.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -cd ../.. - -# test -graph create test/poco --node http://127.0.0.1:8020 -graph deploy test/poco subgraph.test.yaml --node http://127.0.0.1:8020 --ipfs http://127.0.01:5001 --version-label 0.0.1 - -echo "browse test/poco subgraph at http://127.0.0.1:8000/subgraphs/name/test/poco/graphql" diff --git a/docker/test/docker-compose.yml b/docker/test/docker-compose.yml deleted file mode 100644 index fb4dcba..0000000 --- a/docker/test/docker-compose.yml +++ /dev/null @@ -1,63 +0,0 @@ -services: - chain: - image: docker-regis.iex.ec/poco-chain:1.0.0-poco-v5.5.0-voucher-v1.0.0-nethermind - restart: unless-stopped - ports: - - 8545:8545 - # - 8546:8546 # port (not required for integration tests) fails to open on CI - - ipfs: - restart: unless-stopped - image: ipfs/go-ipfs:v0.22.0 - ports: - - 8080:8080 - - 5001:5001 - - graphnode-postgres: - image: postgres:16.4 - restart: unless-stopped - command: - - "postgres" - - "-cshared_preload_libraries=pg_stat_statements" - expose: - - 5432 - environment: - POSTGRES_USER: ${DB_USER} - POSTGRES_PASSWORD: ${DB_PASSWORD} - POSTGRES_DB: ${DB_NAME} - POSTGRES_INITDB_ARGS: "-E UTF8 --locale=C" - - graphnode: - image: graphprotocol/graph-node:v0.35.1 - restart: unless-stopped - ports: - - 8000:8000 # GraphQL HTTP - # - 8001:8001 # GraphQL WS - - 8020:8020 # admin RPC - # - 8040:8040 # metrics - environment: - postgres_host: graphnode-postgres - postgres_port: 5432 - postgres_user: ${DB_USER} - postgres_pass: ${DB_PASSWORD} - postgres_db: ${DB_NAME} - ipfs: ipfs:5001 - ethereum: ${NETWORK_NAME}:http://chain:8545 - healthcheck: - test: netcat -w 1 0.0.0.0 8020 - interval: 10s - timeout: 5s - retries: 10 - start_period: 30s - - poco-subgraph-deployer: - build: - context: ../.. - dockerfile: docker/Dockerfile - environment: - GRAPHNODE_URL: http://graphnode:8020 - IPFS_URL: http://ipfs:5001 - NETWORK_NAME: ${NETWORK_NAME} - depends_on: - graphnode: - condition: service_healthy diff --git a/docker/viviani/.env b/docker/viviani/.env deleted file mode 100644 index 21fb9d5..0000000 --- a/docker/viviani/.env +++ /dev/null @@ -1,4 +0,0 @@ -DATA=/home/pierre/tmp/graph-viviani -DB_USER=graphnode -DB_PASSWORD=somerandompasswordthatishardtoguess -DB_NAME=graphnode-viviani diff --git a/docker/viviani/deploy-subgraph.sh b/docker/viviani/deploy-subgraph.sh deleted file mode 100755 index b7f274a..0000000 --- a/docker/viviani/deploy-subgraph.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -cd ../.. - -# viviani -graph create viviani/poco --node http://127.0.0.1:8020 -graph deploy viviani/poco subgraph.viviani.yaml --node http://127.0.0.1:8020 --ipfs http://127.0.01:5001 --version-label 0.0.1 - -echo "browse viviani/poco subgraph at http://127.0.0.1:8000/subgraphs/name/viviani/poco/graphql" diff --git a/docker/viviani/docker-compose.yml b/docker/viviani/docker-compose.yml deleted file mode 100644 index 0f62af5..0000000 --- a/docker/viviani/docker-compose.yml +++ /dev/null @@ -1,62 +0,0 @@ -version: "3" - -networks: - thegraph: - blockchain: - external: - name: viviani_blockchain - -services: - ipfs: - image: ipfs/go-ipfs:v0.10.0 - restart: unless-stopped - networks: - - thegraph - expose: - - 5001 - ports: - - 5001:5001 - volumes: - - ${DATA}/ipfs:/data/ipfs - - postgres: - image: postgres:12 - restart: unless-stopped - networks: - - thegraph - command: - - "postgres" - - "-cshared_preload_libraries=pg_stat_statements" - expose: - - 5432 - environment: - POSTGRES_USER: "${DB_USER}" - POSTGRES_PASSWORD: "${DB_PASSWORD}" - POSTGRES_DB: "${DB_NAME}" - volumes: - - ${DATA}/postgres:/var/lib/postgresql/data - - graphnode: - image: graphprotocol/graph-node:v0.27.0 - restart: unless-stopped - networks: - - blockchain - - thegraph - depends_on: - - ipfs - - postgres - ports: - - 8000:8000 # http - - 8001:8001 # ws - - 8020:8020 # deploy - - 8030:8030 # monitoring - - 8040:8040 # prometeus - environment: - RUST_BACKTRACE: 1 - postgres_host: postgres - postgres_user: "${DB_USER}" - postgres_pass: "${DB_PASSWORD}" - postgres_db: "${DB_NAME}" - ipfs: "ipfs:5001" - ethereum: "viviani:http://viviani-archive-node:8545" - GRAPH_NODE_ID: "graphnode_id" diff --git a/matchstick.yaml b/matchstick.yaml deleted file mode 100644 index 7e965e7..0000000 --- a/matchstick.yaml +++ /dev/null @@ -1,2 +0,0 @@ -testsFolder: test -manifestPath: subgraph.yaml diff --git a/package-lock.json b/package-lock.json index 4199ac0..af3ba21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,8 @@ "mocha": "^10.7.3", "prettier": "^3.3.3", "prettier-plugin-organize-imports": "^4.1.0", - "testcontainers": "^10.13.2" + "testcontainers": "^10.13.2", + "tsx": "^4.19.3" } }, "node_modules/@adraffy/ens-normalize": { @@ -119,6 +120,431 @@ "node": ">=12" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.2.tgz", + "integrity": "sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.2.tgz", + "integrity": "sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.2.tgz", + "integrity": "sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.2.tgz", + "integrity": "sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.2.tgz", + "integrity": "sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.2.tgz", + "integrity": "sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.2.tgz", + "integrity": "sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.2.tgz", + "integrity": "sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.2.tgz", + "integrity": "sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.2.tgz", + "integrity": "sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.2.tgz", + "integrity": "sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.2.tgz", + "integrity": "sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.2.tgz", + "integrity": "sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.2.tgz", + "integrity": "sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.2.tgz", + "integrity": "sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.2.tgz", + "integrity": "sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.2.tgz", + "integrity": "sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.2.tgz", + "integrity": "sha512-talAIBoY5M8vHc6EeI2WW9d/CkiO9MQJ0IOWX8hrLhxGbro/vBXJvaQXefW2cP0z0nQVTdQ/eNyGFV1GSKrxfw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.2.tgz", + "integrity": "sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.2.tgz", + "integrity": "sha512-dcXYOC6NXOqcykeDlwId9kB6OkPUxOEqU+rkrYVqJbK2hagWOMrsTGsMr8+rW02M+d5Op5NNlgMmjzecaRf7Tg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.2.tgz", + "integrity": "sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.2.tgz", + "integrity": "sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.2.tgz", + "integrity": "sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.2.tgz", + "integrity": "sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.2.tgz", + "integrity": "sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@ethersproject/abi": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.0.7.tgz", @@ -3511,6 +3937,47 @@ "es6-promise": "^4.0.3" } }, + "node_modules/esbuild": { + "version": "0.25.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.2.tgz", + "integrity": "sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.2", + "@esbuild/android-arm": "0.25.2", + "@esbuild/android-arm64": "0.25.2", + "@esbuild/android-x64": "0.25.2", + "@esbuild/darwin-arm64": "0.25.2", + "@esbuild/darwin-x64": "0.25.2", + "@esbuild/freebsd-arm64": "0.25.2", + "@esbuild/freebsd-x64": "0.25.2", + "@esbuild/linux-arm": "0.25.2", + "@esbuild/linux-arm64": "0.25.2", + "@esbuild/linux-ia32": "0.25.2", + "@esbuild/linux-loong64": "0.25.2", + "@esbuild/linux-mips64el": "0.25.2", + "@esbuild/linux-ppc64": "0.25.2", + "@esbuild/linux-riscv64": "0.25.2", + "@esbuild/linux-s390x": "0.25.2", + "@esbuild/linux-x64": "0.25.2", + "@esbuild/netbsd-arm64": "0.25.2", + "@esbuild/netbsd-x64": "0.25.2", + "@esbuild/openbsd-arm64": "0.25.2", + "@esbuild/openbsd-x64": "0.25.2", + "@esbuild/sunos-x64": "0.25.2", + "@esbuild/win32-arm64": "0.25.2", + "@esbuild/win32-ia32": "0.25.2", + "@esbuild/win32-x64": "0.25.2" + } + }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -4204,6 +4671,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz", + "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob": { "version": "9.3.5", "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", @@ -7304,6 +7784,16 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/response-iterator": { "version": "0.2.6", "resolved": "https://registry.npmjs.org/response-iterator/-/response-iterator-0.2.6.tgz", @@ -8586,6 +9076,26 @@ "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==", "dev": true }, + "node_modules/tsx": { + "version": "4.19.3", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.3.tgz", + "integrity": "sha512-4H8vUNGNjQ4V2EOoGw005+c+dGuPSnhpPBPHBtsZdGZBk/iJb4kguGlPWaZTZ3q5nMtFOEsY0nRDlh9PJyd6SQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.25.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, "node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", diff --git a/package.json b/package.json index 792a1c9..d9d358d 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "mocha": "^10.7.3", "prettier": "^3.3.3", "prettier-plugin-organize-imports": "^4.1.0", - "testcontainers": "^10.13.2" + "testcontainers": "^10.13.2", + "tsx": "^4.19.3" }, "dependencies": { "@iexec/poco": "^5.5.0", diff --git a/subgraph.bellecour.yaml b/subgraph.bellecour.yaml deleted file mode 100644 index 52feb4a..0000000 --- a/subgraph.bellecour.yaml +++ /dev/null @@ -1,210 +0,0 @@ -# SPDX-FileCopyrightText: 2020-2024 IEXEC BLOCKCHAIN TECH -# SPDX-License-Identifier: Apache-2.0 - -specVersion: 0.0.4 -description: iExecPoCoV5 -repository: https://github.com/iExecBlockchainComputing/PoCo-subgraph -schema: - file: ./schema.graphql -dataSources: - - name: ERC1538 - kind: ethereum/contract - network: bellecour - source: - address: "0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f" - abi: ERC1538 - startBlock: 4543300 - mapping: - kind: ethereum/events - apiVersion: 0.0.6 - language: wasm/assemblyscript - entities: - - ERC1538Module - - ERC1538Function - - ERC1538FunctionUpdateEvent - - ERC1538CommitMessageEvent - abis: - - name: ERC1538 - file: node_modules/@iexec/solidity/build/contracts/IERC1538.json - eventHandlers: - - event: CommitMessage(string) - handler: handleCommitMessage - - event: FunctionUpdate(indexed bytes4,indexed address,indexed address,string) - handler: handleFunctionUpdate - file: ./src/ERC1538/ERC1538.ts - - - name: Core - kind: ethereum/contract - network: bellecour - source: - address: "0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f" - abi: IexecInterfaceToken - startBlock: 4543300 - mapping: - kind: ethereum/events - apiVersion: 0.0.6 - language: wasm/assemblyscript - entities: - - Category - - Account - - AppOrder - - DatasetOrder - - WorkerpoolOrder - - RequesterOrder - - Deal - - SchedulerNotice - - Task - - Contribution - - TaskInitialize - - TaskContribute - - TaskConsensus - - TaskReveal - - TaskReopen - - TaskFinalize - - TaskClaimed - - AccurateContribution - - FaultyContribution - - Transfer - - Reward - - Seize - - Lock - - Unlock - abis: - - name: IexecInterfaceToken - file: node_modules/@iexec/poco/artifacts/contracts/IexecInterfaceNative.sol/IexecInterfaceNative.json - eventHandlers: - - event: CreateCategory(uint256,string,string,uint256) - handler: handleCreateCategory - - event: OrdersMatched(bytes32,bytes32,bytes32,bytes32,bytes32,uint256) - handler: handleOrdersMatched - - event: SchedulerNotice(indexed address,bytes32) - handler: handleSchedulerNotice - - event: TaskInitialize(indexed bytes32,indexed address) - handler: handleTaskInitialize - - event: TaskContribute(indexed bytes32,indexed address,bytes32) - handler: handleTaskContribute - - event: TaskConsensus(indexed bytes32,bytes32) - handler: handleTaskConsensus - - event: TaskReveal(indexed bytes32,indexed address,bytes32) - handler: handleTaskReveal - - event: TaskReopen(indexed bytes32) - handler: handleTaskReopen - - event: TaskFinalize(indexed bytes32,bytes) - handler: handleTaskFinalize - - event: TaskClaimed(indexed bytes32) - handler: handleTaskClaimed - - event: AccurateContribution(indexed address,indexed bytes32) - handler: handleAccurateContribution - - event: FaultyContribution(indexed address,indexed bytes32) - handler: handleFaultyContribution - - event: Transfer(indexed address,indexed address,uint256) - handler: handleTransfer - - event: Reward(address,uint256,bytes32) - handler: handleReward - - event: Seize(address,uint256,bytes32) - handler: handleSeize - - event: Lock(address,uint256) - handler: handleLock - - event: Unlock(address,uint256) - handler: handleUnlock - callHandlers: - - function: matchOrders((address,uint256,uint256,bytes32,address,address,address,bytes32,bytes),(address,uint256,uint256,bytes32,address,address,address,bytes32,bytes),(address,uint256,uint256,bytes32,uint256,uint256,address,address,address,bytes32,bytes),(address,uint256,address,uint256,address,uint256,address,uint256,bytes32,uint256,uint256,address,address,string,bytes32,bytes)) - handler: handleMatchOrders - file: ./src/Modules/index.ts - - # =============================== App registry ================================ - - name: AppRegistry - kind: ethereum/contract - network: bellecour - source: - address: "0xB1C52075b276f87b1834919167312221d50c9D16" - abi: AppRegistry - startBlock: 4543300 - mapping: - kind: ethereum/events - apiVersion: 0.0.6 - language: wasm/assemblyscript - entities: - - App - - AppTransfer - abis: - - name: App - file: node_modules/@iexec/poco/build/contracts/App.json - - name: AppRegistry - file: node_modules/@iexec/poco/build/contracts/AppRegistry.json - eventHandlers: - - event: Transfer(indexed address,indexed address,indexed uint256) - handler: handleTransferApp - file: ./src/Registries/index.ts - - # ============================= Dataset registry ============================== - - name: DatasetRegistry - kind: ethereum/contract - network: bellecour - source: - address: "0x799DAa22654128d0C64d5b79eac9283008158730" - abi: DatasetRegistry - startBlock: 4543300 - mapping: - kind: ethereum/events - apiVersion: 0.0.6 - language: wasm/assemblyscript - entities: - - Dataset - - DatasetTransfer - abis: - - name: Dataset - file: node_modules/@iexec/poco/build/contracts/Dataset.json - - name: DatasetRegistry - file: node_modules/@iexec/poco/build/contracts/DatasetRegistry.json - eventHandlers: - - event: Transfer(indexed address,indexed address,indexed uint256) - handler: handleTransferDataset - file: ./src/Registries/index.ts - - # ============================ Workerpool registry ============================ - - name: WorkerpoolRegistry - kind: ethereum/contract - network: bellecour - source: - address: "0xC76A18c78B7e530A165c5683CB1aB134E21938B4" - abi: WorkerpoolRegistry - startBlock: 4543300 - mapping: - kind: ethereum/events - apiVersion: 0.0.6 - language: wasm/assemblyscript - entities: - - Workerpool - - WorkerpoolTransfer - abis: - - name: Workerpool - file: node_modules/@iexec/poco/build/contracts/Workerpool.json - - name: WorkerpoolRegistry - file: node_modules/@iexec/poco/build/contracts/WorkerpoolRegistry.json - eventHandlers: - - event: Transfer(indexed address,indexed address,indexed uint256) - handler: handleTransferWorkerpool - file: ./src/Registries/index.ts - -# ============================ Workerpool template ============================ -templates: - - name: Workerpool - kind: ethereum/contract - network: bellecour - source: - abi: Workerpool - mapping: - kind: ethereum/events - apiVersion: 0.0.6 - language: wasm/assemblyscript - entities: - - Workerpool - - PolicyChange - abis: - - name: Workerpool - file: node_modules/@iexec/poco/build/contracts/Workerpool.json - eventHandlers: - - event: PolicyUpdate(uint256,uint256,uint256,uint256) - handler: handlePolicyUpdate - file: ./src/Registries/index.ts diff --git a/test-stack/prepare-test-env.js b/test-stack/prepare-test-env.ts similarity index 86% rename from test-stack/prepare-test-env.js rename to test-stack/prepare-test-env.ts index 09a7e6d..9af0820 100644 --- a/test-stack/prepare-test-env.js +++ b/test-stack/prepare-test-env.ts @@ -1,3 +1,4 @@ +import { ethers } from 'ethers'; import { existsSync, readFileSync, writeFileSync } from 'fs'; import { dirname, join } from 'path'; import { fileURLToPath } from 'url'; @@ -13,23 +14,14 @@ const networkName = process.env.NETWORK_NAME; // Get the network name from env const networksFilePath = join(__dirname, '..', 'networks.json'); /** - * Fetch the current block number from the fork URL + * Fetch the current block number from the fork URL using ethers * @returns {Promise} The current block number */ async function getCurrentBlockNumber() { try { - const response = await fetch(forkUrl, { - method: 'POST', - body: JSON.stringify({ - jsonrpc: 2.0, - method: 'eth_blockNumber', - params: [], - id: 1, - }), - }); - - const jsonRes = await response.json(); - return parseInt(jsonRes.result.substring(2), 16); + const provider = new ethers.JsonRpcProvider(forkUrl); + const blockNumber = await provider.getBlockNumber(); + return blockNumber; } catch (error) { throw Error(`Failed to get current block number from ${forkUrl}: ${error}`); } @@ -39,7 +31,7 @@ async function getCurrentBlockNumber() { * Create environment files for the test stack * @param {number} forkBlockNumber - The block number to fork from */ -async function createEnvFiles(forkBlockNumber) { +async function createEnvFiles(forkBlockNumber: number) { console.log('Creating .env file for docker-compose test-stack'); writeFileSync( '.env', @@ -58,7 +50,7 @@ async function createEnvFiles(forkBlockNumber) { * Update networks.json file with the current block number * @param {number} forkBlockNumber - The block number to fork from */ -async function updateNetworksFile(forkBlockNumber) { +async function updateNetworksFile(forkBlockNumber: number) { if (!networkName) { console.warn( 'No NETWORK_NAME environment variable provided. The networks.json file will not be updated.', diff --git a/test/Modules/IexecCategoryManager.test.ts b/tests/unit/Modules/IexecCategoryManager.test.ts similarity index 91% rename from test/Modules/IexecCategoryManager.test.ts rename to tests/unit/Modules/IexecCategoryManager.test.ts index d368e3f..8d7b6e4 100644 --- a/test/Modules/IexecCategoryManager.test.ts +++ b/tests/unit/Modules/IexecCategoryManager.test.ts @@ -3,8 +3,8 @@ import { ethereum } from '@graphprotocol/graph-ts'; import { assert, describe, newTypedMockEventWithParams, test } from 'matchstick-as/assembly/index'; -import { CreateCategory } from '../../generated/Core/IexecInterfaceToken'; -import { handleCreateCategory } from '../../src/Modules'; +import { CreateCategory } from '../../../generated/Core/IexecInterfaceToken'; +import { handleCreateCategory } from '../../../src/Modules'; describe('IexecCategoryManager', () => { test('Should handle CreateCategory', () => { diff --git a/test/Modules/IexecPoco.test.ts b/tests/unit/Modules/IexecPoco.test.ts similarity index 96% rename from test/Modules/IexecPoco.test.ts rename to tests/unit/Modules/IexecPoco.test.ts index 27e3778..fe1cb86 100644 --- a/test/Modules/IexecPoco.test.ts +++ b/tests/unit/Modules/IexecPoco.test.ts @@ -3,9 +3,9 @@ import { BigInt, ethereum } from '@graphprotocol/graph-ts'; import { assert, describe, newTypedMockEventWithParams, test } from 'matchstick-as/assembly/index'; -import { OrdersMatched } from '../../generated/Core/IexecInterfaceToken'; -import { handleOrdersMatched } from '../../src/Modules'; -import { toRLC } from '../../src/utils'; +import { OrdersMatched } from '../../../generated/Core/IexecInterfaceToken'; +import { handleOrdersMatched } from '../../../src/Modules'; +import { toRLC } from '../../../src/utils'; import { EventParamBuilder } from '../utils/EventParamBuilder'; import { buildDeal, mockAddress, mockBytes32, mockViewDeal } from '../utils/mock'; diff --git a/test/utils/EventParamBuilder.ts b/tests/unit/utils/EventParamBuilder.ts similarity index 100% rename from test/utils/EventParamBuilder.ts rename to tests/unit/utils/EventParamBuilder.ts diff --git a/test/utils/mock.ts b/tests/unit/utils/mock.ts similarity index 100% rename from test/utils/mock.ts rename to tests/unit/utils/mock.ts