Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TW-1343: [epic] EVM arch prep #1159

Merged
merged 27 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f628222
TW-1345: [EVM] Accounts derivation (#1119)
alex-tsx Apr 1, 2024
5069e8f
Merge branch 'development-2' into TW-1343-epic-evm-arch-prep
alex-tsx Apr 1, 2024
7a1c767
Merge branch 'development-2' into TW-1343-epic-evm-arch-prep
alex-tsx Apr 16, 2024
28e3882
Merge branch 'development-2' into TW-1343-epic-evm-arch-prep
alex-tsx Apr 18, 2024
f27c47a
TW-1413: [EVM] Networks (#1120)
alex-tsx Apr 24, 2024
3dd92d8
TW-1412: Import with seed phrase (#1137)
keshan3262 May 3, 2024
0ed3842
TW-1360: [EVM] Home page design (#1136)
alex-tsx May 16, 2024
738e23c
Merge branch 'development-2' into TW-1343-epic-evm-arch-prep
alex-tsx May 16, 2024
142c4fe
TW-1406: [EVM] Balances loading (#1128)
lendihop Jun 11, 2024
4475db3
Merge branch 'development-2' into TW-1343-epic-evm-arch-prep
alex-tsx Jun 20, 2024
c97dea1
TW-1343: [epic] EVM arch prep. Fix deps audit. ++ 'viem' for 'ws'
alex-tsx Jun 20, 2024
33d1300
TW-1343: [epic] EVM arch prep. Fix deps. + '@types/ws'
alex-tsx Jun 20, 2024
4b02a61
TW-1343: [epic] EVM arch prep. Fix build. -- unused icons
alex-tsx Jun 20, 2024
27e963b
TW-1454: [e2e] Playwright set-up (#1149)
tttt24 Jun 25, 2024
bc6efc3
Merge branch 'development-2' into TW-1343-epic-evm-arch-prep
alex-tsx Jun 26, 2024
bb1ffd3
TW-1416: [EVM] Assets management (#1150)
lendihop Jul 30, 2024
b9de480
TW-1461: [EVM] Final epic QA (#1175)
alex-tsx Jul 30, 2024
d265365
Merge branch 'development-2' into TW-1343-epic-evm-arch-prep
alex-tsx Jul 30, 2024
74608f3
TW-1343: [evm][epic] Final QA. Fix useAssetUSDPrice() after Assets Ma…
alex-tsx Jul 31, 2024
039373b
Merge branch 'development-2' into TW-1343-epic-evm-arch-prep
alex-tsx Aug 8, 2024
4d88532
TW-1461: [EVM][QA] Final arch prep epic QA (#1177)
alex-tsx Aug 12, 2024
046f59c
TW-1461: [EVM][QA] Final arch prep epic QA. Not hiding NFTs without m…
alex-tsx Aug 13, 2024
ecbcd5e
TW-1343: [epic][EVM] Arch prep. Temporarily allow axios dep vulnerabi…
alex-tsx Aug 13, 2024
aab30ed
TW-1461: [EVM][QA] Final arch prep epic QA. Minor UI fixes
alex-tsx Aug 13, 2024
ad52fd6
TW-1461: [evm] EVM arch prep epic QA (#1181)
alex-tsx Aug 14, 2024
1903224
TW-1343: [epic][EVM] Arch prep. Fix audit-deps.js. Upgraded axios
alex-tsx Aug 14, 2024
244f14d
TW-1461: [EVM][QA] Final arch prep epic QA. Add Asset. Fix tokenId fi…
alex-tsx Aug 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

3 changes: 1 addition & 2 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[production]
chrome >= 103
firefox >= 52
opera >= 36
safari >= 14
opera >= 70

[development]
last 1 chrome version
Expand Down
73 changes: 65 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
{
"root": true,

"extends": [
"react-app",
"eslint:recommended",
"plugin:@typescript-eslint/strict",
"plugin:jsx-a11y/strict",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript"
],
"plugins": ["import", "prettier", "no-type-assertion"],
"parser": "@typescript-eslint/parser",

"plugins": ["import", "prettier", "@typescript-eslint", "no-type-assertion", "react", "react-hooks", "jsx-a11y"],

"ignorePatterns": "src/**/*.embed.js",

"overrides": [{
"files": ["*.ts", "*.tsx"],
"files": ["**/*.ts?(x)"],

"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json", "./e2e/tsconfig.json", "./webpack/tsconfig.json"]
"ecmaVersion": 2020,

// typescript-eslint specific options
"project": ["tsconfig.json", "e2e/tsconfig.json", "webpack/tsconfig.json"],
"warnOnUnsupportedTypeScriptVersion": true
}
}],

"settings": {
"import/resolver": {
"typescript": {
Expand All @@ -21,12 +37,24 @@
"node": {
"extensions": [".d.ts"]
}
},
"react": {
"version": "detect"
}
},
"ignorePatterns": "src/**/*.embed.js",

"rules": {
"prettier/prettier": "error",

"prefer-const": "error",
"no-undef": "off",
"no-unused-vars": "off",
"no-empty": "warn",
"no-case-declarations": "off",
"prefer-rest-params": "off",
"no-async-promise-executor": "off",
"no-prototype-builtins": "warn",

"import/no-duplicates": "error",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
Expand All @@ -51,12 +79,41 @@
"newlines-between": "always"
}
],

"no-type-assertion/no-type-assertion": "warn",

"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/prefer-ts-expect-error": "error",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/unified-signatures": "off",
"@typescript-eslint/switch-exhaustiveness-check": "warn",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/no-dynamic-delete": "off",
"@typescript-eslint/prefer-literal-enum-member": "off",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",

"react/prop-types": "off",
"react/display-name": "off",
"react-hooks/rules-of-hooks": "warn",
"react-hooks/exhaustive-deps": ["warn", {
"additionalHooks": "(useMemoWithCompare|useDidUpdate)"
}]
"additionalHooks": "(useMemoWithCompare|useDidUpdate|useInterval)"
}],
"react/jsx-key": "warn",
"react/no-unescaped-entities": "off",

"jsx-a11y/no-autofocus": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/alt-text": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/media-has-caption": "warn",
"jsx-a11y/no-noninteractive-tabindex": "off",
"jsx-a11y/tabindex-no-positive": "off"
}
}
1 change: 1 addition & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- development
- development-2
- 'TW-[0-9]+-epic-**'

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
uses: adrey/slack-file-upload-action@master
with:
token: ${{ secrets.SLACK_E2E_VIDEO_UPLOADER_TOKEN }}
path: e2e/video-rep/test-runs.mp4
path: e2e/test-results/video-result.webm
channel: temple-test-runs
initial_comment: <https://github.com/madfish-solutions/templewallet-extension/pull/${{ github.event.number }}|${{ github.event.pull_request.title }}> (Run <https://github.com/madfish-solutions/templewallet-extension/actions/runs/${{ github.run_id }}|№${{ github.run_number }}>)

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ node_modules/
.DS_Store
/.idea
.vscode
.npmrc

npm-debug.log*
yarn-debug.log*
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Temple - Tezos Wallet
# Temple Wallet

Cryptocurrency wallet for [Tezos blockchain](https://tezos.com) as Web Extension for your Browser.<br>
Providing ability to manage NFT, tez tokens and interact with dApps.
Expand Down
6 changes: 5 additions & 1 deletion audit-deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ exec('yarn audit --level high', (error, stdout, stderr) => {
console.log(stdout);

if (stdout.includes('High') || stdout.includes('Critical')) {
throw new Error('Audit failed');
const countHigh = stdout.match(/Severity: .* (\d+) High/)?.[1];
const countCritical = stdout.match(/Severity: .* (\d+) Critical/)?.[1];
const count = (countHigh ? Number(countHigh) : 0) + (countCritical ? Number(countCritical) : 0);

throw new Error(`Audit failed with ${count} vulnerabilities`);
}
}
});
34 changes: 0 additions & 34 deletions e2e/.env.dist

This file was deleted.

6 changes: 6 additions & 0 deletions e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# dependencies
node_modules/

.env

test-results/
7 changes: 0 additions & 7 deletions e2e/cucumber.json

This file was deleted.

35 changes: 7 additions & 28 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,20 @@
{
"name": "temple-wallet-extension-e2e",
"version": "1.0.0",
"version": "2.0.0",
"private": true,
"license": "MIT",
"scripts": {
"start": "./node_modules/.bin/cucumber-js --fail-fast",
"start:dev": "yarn start --tags @dev",
"start:NFT": "yarn start --tags @collectibles",
"start:remove_account": "yarn start --tags @remove_account",
"start:create_account": "yarn start --tags @create_account",
"start:address_book": "yarn start --tags @address_book",
"start:custom_node": "yarn start --tags @custom_node",
"start:unlock_screen": "yarn start --tags @unlock_screen",
"start:manage_assets": "yarn start --tags @manage_assets",
"start:home": "yarn start --tags @home",
"start:create_new_wallet": "yarn start --tags @create_new_wallet",
"start:delegate": "yarn start --tags @delegate",
"start:import_account_mnemonic": "yarn start --tags @import_account_mnemonic",
"start:import_account_private_key": "yarn start --tags @import_account_private_key",
"start:import_account_public_key": "yarn start --tags @import_account_public_key",
"start:import_wallet": "yarn start --tags @import_wallet",
"start:reveal_private_key": "yarn start --tags @reveal_private_key",
"start:reveal_mnemonic": "yarn start --tags @reveal_mnemonic",
"start:send": "yarn start --tags @send",
"start:swap": "yarn start --tags @swap",
"start:notifications": "yarn start --tags @notifications",
"test": "yarn start --exit --tags 'not @dev'",
"install": "yarn playwright install chromium",
"test": "yarn playwright test",
"test-fast": "yarn playwright test --max-failures=1",
"ts": "tsc --pretty"
},
"dependencies": {
"@cucumber/cucumber": "^9.4.0",
"@types/chai": "^4.3.4",
"@playwright/test": "^1.44.0",
"@types/node": "^20.12.2",
"async-retry": "^1.3.3",
"chai": "^4.3.7",
"dotenv": "^16.0.3",
"puppeteer": "^19.11.1",
"puppeteer-screen-recorder": "^2.1.2",
"playwright": "^1.44.0",
"ts-node": "^10.9.1"
}
}
15 changes: 15 additions & 0 deletions e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
fullyParallel: false,
testDir: './src',
workers: 1,
projects: [
{
name: 'chromium',
use: { browserName: 'chromium' }
}
]
};

export default config;
19 changes: 5 additions & 14 deletions e2e/src/classes/browser-context.class.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import { Browser, Page } from 'puppeteer';
import { PuppeteerScreenRecorder } from 'puppeteer-screen-recorder';
import { BrowserContext, Page } from '@playwright/test';

import { envVars } from '../utils/env.utils';

export class BrowserContext {
public static EXTENSION_ID: string;
public static browser: Browser;
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
export class CustomBrowserContext {
public static EXTENSION_URL: string;
public static browser: BrowserContext;
public static page: Page;
public static seedPhrase = envVars.DEFAULT_HD_ACCOUNT_SEED_PHRASE;
public static password = envVars.DEFAULT_PASSWORD;
public static recorder: PuppeteerScreenRecorder;
public static resetPrivates = () => {
BrowserContext.seedPhrase = envVars.DEFAULT_HD_ACCOUNT_SEED_PHRASE;
BrowserContext.password = envVars.DEFAULT_PASSWORD;
};
}
4 changes: 2 additions & 2 deletions e2e/src/classes/page.class.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { BrowserContext } from 'e2e/src/classes/browser-context.class';
import { CustomBrowserContext } from './browser-context.class';

export abstract class Page {
abstract isVisible(timeout?: number): void;

scrollTo(topPositionPx: number) {
return BrowserContext.page.evaluate(top => {
return CustomBrowserContext.page.evaluate(top => {
if (top <= 0 && window.pageYOffset === 0) return Promise.resolve(false);

window.scrollTo({ top, behavior: 'smooth' });
Expand Down
Loading
Loading