Skip to content

Commit

Permalink
Update wallet-connect-test bench.
Browse files Browse the repository at this point in the history
  • Loading branch information
abizjak committed Apr 12, 2024
1 parent b13950b commit 1646d86
Show file tree
Hide file tree
Showing 23 changed files with 6,007 additions and 4,838 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release-wallet-test-bench.yml
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 }}
116 changes: 63 additions & 53 deletions wallet-connect-test-bench/front-end/.eslintrc.js
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 wallet-connect-test-bench/front-end/.yarn/releases/yarn-3.6.3.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions wallet-connect-test-bench/front-end/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
yarnPath: .yarn/releases/yarn-3.6.3.cjs
nodeLinker: node-modules
2 changes: 1 addition & 1 deletion wallet-connect-test-bench/front-end/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
## 1.4.0

- Add link to source code
- Change that selected switch option is in bold font
- Change that selected switch option is in bold font

## 1.2.0

Expand Down
35 changes: 0 additions & 35 deletions wallet-connect-test-bench/front-end/Jenkinsfile

This file was deleted.

23 changes: 12 additions & 11 deletions wallet-connect-test-bench/front-end/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
```
Expand Down Expand Up @@ -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.

63 changes: 0 additions & 63 deletions wallet-connect-test-bench/front-end/esbuild.config.ts

This file was deleted.

17 changes: 17 additions & 0 deletions wallet-connect-test-bench/front-end/index.html
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>
Loading

0 comments on commit 1646d86

Please sign in to comment.