-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a239854
commit a266142
Showing
44 changed files
with
1,920 additions
and
1,239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
# Exclude all: | ||
* | ||
|
||
# Include what is actually used: | ||
!package.json | ||
!yarn.lock | ||
!tsconfig.json | ||
!env.*.config.json | ||
!src | ||
|
||
/src/**/*.e2e.ts | ||
/src/**/*.spec.ts | ||
.github | ||
.env | ||
/node_modules | ||
/build | ||
/client | ||
/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ jobs: | |
- name: Setup Node.js for use with actions | ||
uses: actions/[email protected] | ||
with: | ||
node-version: "18.16" | ||
node-version: 20 | ||
- run: yarn install --frozen-lockfile | ||
- name: Download Polkadot and parachain binaries | ||
run: | | ||
|
@@ -36,8 +36,8 @@ jobs: | |
source wait_until.sh 'curl -s "127.0.0.1:9933"' | ||
source wait_until.sh 'curl -s "127.0.0.1:9934"' | ||
working-directory: e2e | ||
- name: Build e2e types | ||
run: yarn generate:papi:e2e | ||
- name: Generate PAPI types | ||
run: yarn generate:papi | ||
- name: Build faucet | ||
run: yarn build:docker | ||
- name: Run the E2E tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
FROM docker.io/library/node:18.16.0-alpine | ||
FROM docker.io/library/node:20.11.1-alpine | ||
|
||
# uncomment to fix build on MacOS Apple Silicon chip | ||
# RUN apk add --no-cache python3 make g++ | ||
RUN apk add git | ||
RUN apk add --no-cache python3 make g++ | ||
# RUN apk add git | ||
|
||
ARG VCS_REF=master | ||
ARG BUILD_DATE="" | ||
|
@@ -20,7 +20,7 @@ LABEL io.parity.image.authors="[email protected]" \ | |
|
||
WORKDIR /faucet | ||
|
||
COPY ./package.json ./yarn.lock ./ | ||
COPY ./package.json ./yarn.lock ./polkadot-api.json ./ | ||
RUN yarn --frozen-lockfile | ||
|
||
COPY . . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,7 @@ command -v polkadot-parachain || echo "No polkadot-parachain in PATH" | |
Next, in the root of this repository, start the Zombienet: | ||
|
||
```bash | ||
npx --yes @zombienet/[email protected] --provider native --dir e2e/zombienet_logs spawn e2e/zombienet.native.toml | ||
yarn e2e:zombienet | ||
``` | ||
|
||
Verify that it's working correctly by opening the [relaychain](https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9933#/explorer) and [parachain](https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9934#/explorer) explorers, | ||
|
@@ -103,12 +103,7 @@ curl localhost:9934 | |
yarn build:docker | ||
``` | ||
|
||
4. Generate PAPI types for e2e tests | ||
|
||
```bash | ||
yarn generate:papi:e2e | ||
``` | ||
|
||
# TODO: UPDATE DOCS | ||
These types are generated based on `.scale` files in `e2e/` directory. To regenerate these files using live zombienet nodes, use `papi update --config e2e/polkadot-api-e2e.json` command. | ||
|
||
5. Run the tests | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
const commonConfig = require("./jest.config"); | ||
|
||
/** @type {import("ts-jest/dist/types").InitialOptionsTsJest} */ | ||
module.exports = { ...commonConfig, testMatch: ["**/?(*.)+(e2e).[jt]s?(x)"], testTimeout: 60_000 }; | ||
module.exports = { | ||
...commonConfig, | ||
testRegex: ["\\w+\\.(e2e).ts"], | ||
testTimeout: 60_000, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,16 +11,17 @@ | |
"fix": "yarn lint:fix && yarn format:fix", | ||
"format": "prettier ./src ./client/src ./client/tests --check", | ||
"format:fix": "prettier ./src ./client/src ./client/tests --write", | ||
"generate:papi": "papi generate", | ||
"generate:types": "echo \"declare const schema: $(cat env.faucet.config.json); export default schema;\" > env.faucet.config.json.d.ts", | ||
"generate:papi:e2e": "papi generate --config e2e/polkadot-api-e2e.json", | ||
"lint": "eslint ./src/ ./client/src ./client/tests --ext .js,.ts,.svelte", | ||
"lint:fix": "eslint ./src/ ./client/src ./client/tests --ext .js,.ts,.svelte --fix", | ||
"migrations:generate": "typeorm-ts-node-commonjs migration:generate -d src/db/dataSource.ts", | ||
"migrations:run": "typeorm-ts-node-commonjs migration:run -d src/db/dataSource.ts", | ||
"postinstall": "yarn generate:types", | ||
"prebuild": "yarn generate:types", | ||
"prebuild": "yarn generate:types && yarn generate:papi", | ||
"prepare": "ts-patch install -s", | ||
"start": "node ./build/src/start.js", | ||
"e2e:zombienet": "rm -rf e2e/zombienet && npx --yes @zombienet/[email protected] --provider native --dir e2e/zombienet spawn e2e/zombienet.native.toml", | ||
"test": "jest", | ||
"test:e2e": "NODE_OPTIONS='--experimental-vm-modules --es-module-specifier-resolution=node' jest -c jest.e2e.config.js --runInBand --forceExit", | ||
"typecheck": "tsc --noEmit" | ||
|
@@ -50,26 +51,20 @@ | |
}, | ||
"dependencies": { | ||
"@eng-automation/js": "^1.0.3", | ||
"@polkadot-api/cli": "^0.0.1-0027dd301d1d5a078e9c770a18e27aed76a66f50.1.0", | ||
"@polkadot-api/client": "^0.0.1-0027dd301d1d5a078e9c770a18e27aed76a66f50.1.0", | ||
"@polkadot-api/node-polkadot-provider": "^0.0.1-0027dd301d1d5a078e9c770a18e27aed76a66f50.1.0", | ||
"@polkadot-api/ws-provider": "^0.0.1-0027dd301d1d5a078e9c770a18e27aed76a66f50.1.0", | ||
"@polkadot/api": "^10.10.1", | ||
"@polkadot/keyring": "^12.5.1", | ||
"@polkadot/util": "^12.5.1", | ||
"@polkadot/util-crypto": "^12.5.1", | ||
"@polkadot/wasm-crypto": "^7.2.2", | ||
"@polkadot/x-randomvalues": "^12.5.1", | ||
"@polkadot-labs/hdkd": "^0.0.6", | ||
"@polkadot-labs/hdkd-helpers": "^0.0.6", | ||
"@types/cors": "^2.8.13", | ||
"axios": "^1.6.0", | ||
"bigfloat.js": "^3.0.1", | ||
"blake2": "^5.0.0", | ||
"body-parser": "^1.20.0", | ||
"bs58": "^5.0.0", | ||
"confmgr": "^1.0.8", | ||
"cors": "^2.8.5", | ||
"express": "4.19.2", | ||
"matrix-js-sdk": "^26.1.0", | ||
"pg": "^8.11.2", | ||
"polkadot-api": "^0.7.0", | ||
"prom-client": "^14.2.0", | ||
"reflect-metadata": "^0.1.13", | ||
"request": "^2.88.2", | ||
|
@@ -91,11 +86,11 @@ | |
"rxjs": "^7.8.1", | ||
"simple-git-hooks": "^2.7.0", | ||
"supertest": "^6.3.3", | ||
"testcontainers": "^9.9.1", | ||
"testcontainers": "v10.8.1", | ||
"ts-jest": "^29.0.5", | ||
"ts-node": "^10.9.1", | ||
"ts-patch": "^2.1.0", | ||
"typescript": "^4.9.3", | ||
"typescript-transform-paths": "^3.4.6" | ||
"ts-patch": "^3.1.2", | ||
"typescript": "^5.3.2", | ||
"typescript-transform-paths": "^3.4.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"rococo": { | ||
"chain": "rococo_v2_2", | ||
"metadata": "src/papi/chains/data/rococo.scale" | ||
}, | ||
"westend": { | ||
"chain": "westend2", | ||
"metadata": "src/papi/chains/data/westend.scale" | ||
}, | ||
"e2e_relaychain": { | ||
"wsUrl": "ws://127.0.0.1:9933", | ||
"metadata": "src/papi/chains/data/e2e_relaychain.scale" | ||
}, | ||
"e2e_parachain": { | ||
"wsUrl": "ws://127.0.0.1:9934", | ||
"metadata": "src/papi/chains/data/e2e_parachain.scale" | ||
}, | ||
"versi": { | ||
"wsUrl": "wss://versi-rpc-node-0.parity-versi.parity.io", | ||
"metadata": "src/papi/chains/data/versi.scale" | ||
}, | ||
"paseo": { | ||
"wsUrl": "wss://paseo.rpc.amforc.com/", | ||
"metadata": "src/papi/chains/data/paseo.scale" | ||
}, | ||
"trappist": { | ||
"wsUrl": "wss://rococo-trappist-rpc.polkadot.io/", | ||
"metadata": "src/papi/chains/data/trappist.scale" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.