-
Notifications
You must be signed in to change notification settings - Fork 6
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
Showing
23 changed files
with
6,007 additions
and
4,838 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: 'Build and push the wallet-test-bench' | ||
on: | ||
push: | ||
tags: | ||
- wallet-connect-test-bench/*.*.* | ||
|
||
env: | ||
REGISTRY: docker.io | ||
IMAGE_NAME: wallet-connect-test-bench | ||
|
||
jobs: | ||
publish-docker-image: | ||
runs-on: ubuntu-latest | ||
environment: testnet-deployments | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
# Uses the `docker/login-action` action to log in to the Container registry. | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Extract version tag from package.json | ||
id: meta | ||
run: | | ||
export VERSION=$(jq -r .version wallet-connect-test-bench/frontend/package.json) | ||
export FULL_IMAGE_TAG="${{ env.REGISTRY }}/concordium/$IMAGE_NAME:$VERSION" | ||
echo "::notice FULL_IMAGE_TAG=${FULL_IMAGE_TAG}" | ||
# Make sure the image does not exist. Abort if we can retrieve any metadata. | ||
if docker manifest inspect ${FULL_IMAGE_TAG} > /dev/null; then | ||
echo "::error ${FULL_IMAGE_TAG} already exists" | ||
exit 1 | ||
elif [ ! "${{ github.ref_name }}" = wallet-connect-test-bench/${VERSION}" ]; then | ||
echo "::error Expected tag ${EXPECTED_TAG} does not match the version ${VERSION}." | ||
exit 1 | ||
else | ||
# Store the full image tag into a tag variable for the following step. | ||
echo "tag=${FULL_IMAGE_TAG}" > "$GITHUB_OUTPUT" | ||
fi | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | ||
with: | ||
context: . | ||
file: ./wallet-connect-test-bench/frontend/Dockerfile | ||
push: true | ||
platforms: linux/amd64 | ||
tags: ${{ steps.meta.outputs.tag }} |
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,57 +1,67 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
extends: ['airbnb', 'airbnb-typescript', 'plugin:prettier/recommended', 'plugin:@typescript-eslint/recommended'], | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
project: 'tsconfig.json', | ||
createDefaultProgram: true, | ||
}, | ||
env: { | ||
browser: true, | ||
jest: true, | ||
node: true, | ||
parser: "@typescript-eslint/parser", | ||
extends: [ | ||
"airbnb", | ||
"airbnb-typescript", | ||
"plugin:prettier/recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: "module", | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
rules: { | ||
'import/prefer-default-export': 0, | ||
'no-restricted-exports': 0, | ||
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'], | ||
'react/jsx-props-no-spreading': 0, | ||
'react/require-default-props': 0, | ||
'class-methods-use-this': 0, | ||
'jsx-a11y/no-autofocus': 0, | ||
'no-await-in-loop': 0, | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: [ | ||
'**/*.stories.tsx', | ||
'**/build/**/*', | ||
'**/*.config.js', | ||
'**/*.config.ts', | ||
'**/test/**/*', | ||
], | ||
}, | ||
], | ||
'jsx-a11y/label-has-associated-control': [ | ||
'error', | ||
{ | ||
required: { | ||
some: ['nesting', 'id'], | ||
}, | ||
}, | ||
project: "tsconfig.json", | ||
createDefaultProgram: true, | ||
}, | ||
env: { | ||
browser: true, | ||
jest: true, | ||
node: true, | ||
}, | ||
rules: { | ||
"import/prefer-default-export": 0, | ||
"no-restricted-exports": 0, | ||
"no-restricted-syntax": [ | ||
"error", | ||
"ForInStatement", | ||
"LabeledStatement", | ||
"WithStatement", | ||
], | ||
"react/jsx-props-no-spreading": 0, | ||
"react/require-default-props": 0, | ||
"class-methods-use-this": 0, | ||
"jsx-a11y/no-autofocus": 0, | ||
"no-await-in-loop": 0, | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
devDependencies: [ | ||
"**/*.stories.tsx", | ||
"**/build/**/*", | ||
"**/*.config.js", | ||
"**/*.config.ts", | ||
"**/test/**/*", | ||
], | ||
'prettier/prettier': [ | ||
'error', | ||
{ | ||
trailingComma: 'es5', | ||
singleQuote: true, | ||
printWidth: 120, | ||
tabWidth: 4, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
"jsx-a11y/label-has-associated-control": [ | ||
"error", | ||
{ | ||
required: { | ||
some: ["nesting", "id"], | ||
}, | ||
}, | ||
], | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
trailingComma: "es5", | ||
singleQuote: true, | ||
printWidth: 120, | ||
tabWidth: 4, | ||
}, | ||
], | ||
}, | ||
}; |
874 changes: 874 additions & 0 deletions
874
wallet-connect-test-bench/front-end/.yarn/releases/yarn-3.6.3.cjs
Large diffs are not rendered by default.
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 +1,2 @@ | ||
yarnPath: .yarn/releases/yarn-3.6.3.cjs | ||
nodeLinker: node-modules |
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 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 |
---|---|---|
|
@@ -4,7 +4,7 @@ A test bench for testing mobile wallets (via walletConnect) or the browser walle | |
|
||
## Prerequisites | ||
|
||
- Browser wallet extension must be installed in Chrome browser and the Concordium testnet needs to be selected or a mobile wallet needs to be set up that supports walletConnect in order to view smart contract details or submit transactions. | ||
- Browser wallet extension must be installed in Chrome browser and the Concordium testnet needs to be selected or a mobile wallet needs to be set up that supports walletConnect in order to view smart contract details or submit transactions. | ||
|
||
## Running the test bench front-end | ||
|
||
|
@@ -15,31 +15,33 @@ git clone --recursive-submodules [email protected]:Concordium/concordium-misc-tools | |
``` | ||
|
||
Navigate into this folder: | ||
|
||
```shell | ||
cd ../wallet-connect-test-bench/front-end | ||
``` | ||
|
||
- Run `yarn install` in this folder. | ||
- Run `yarn preinstall` in this folder. | ||
- Run `yarn install` in this folder. | ||
- Run `yarn install` in this folder. | ||
- Run `yarn preinstall` in this folder. | ||
- Run `yarn install` in this folder. | ||
|
||
To start the front end locally, do the following: | ||
|
||
- Run `yarn build` in this folder. | ||
- Run `yarn start` in this folder. | ||
- Open URL logged in console (typically http://127.0.0.1:8080). | ||
- Run `yarn build` in this folder. | ||
- Run `yarn start` in this folder. | ||
- Open URL logged in console (typically http://127.0.0.1:8080). | ||
|
||
To have hot-reload (useful for development), do the following instead: | ||
|
||
- Run `yarn watch` in this folder in a terminal. | ||
- Run `yarn start` in this folder in another terminal. | ||
- Open URL logged in console (typically http://127.0.0.1:8080). | ||
- Run `yarn watch` in this folder in a terminal. | ||
- Run `yarn start` in this folder in another terminal. | ||
- Open URL logged in console (typically http://127.0.0.1:8080). | ||
|
||
## Using yarn (on Unix/macOS systems) | ||
|
||
Some of the node modules have Windows-type line endings (\r\n), instead of Unix line endings (\n), which causes problems when using an old yarn package manager. | ||
|
||
If you see an error message similar to this when executing `yarn start`, then you've run into the problem: | ||
|
||
```shell | ||
env: node\r: No such file or directory | ||
``` | ||
|
@@ -75,4 +77,3 @@ docker run -it -d -p 8080:80 --name web test_bench:3.0.0 | |
``` | ||
|
||
Open http://127.0.0.1:8080 in your browser. | ||
|
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
rel="stylesheet" | ||
integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" | ||
crossorigin="anonymous" | ||
/> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico" /> | ||
<meta charset="utf-8" /> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/Root.tsx"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.