Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: trezor/trezor-suite
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: db6024a3212a406d6320c2737e9149bbdae81379
Choose a base ref
..
head repository: trezor/trezor-suite
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 59edf234f6ac79bfe64270295cdfa39e1f795709
Choose a head ref
Showing 1,911 changed files with 9,501 additions and 5,912 deletions.
36 changes: 31 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ module.exports = {
'plugin:react/recommended',
'plugin:import/typescript',
'plugin:react-hooks/recommended',
'plugin:jest/recommended',
],
settings: {
react: {
@@ -58,6 +59,9 @@ module.exports = {
'eslint-local-rules/*',
],
rules: {
'no-extra-boolean-cast': 'error',
'no-irregular-whitespace': 'error',
'no-empty': 'error',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/prefer-ts-expect-error': 'error',
@@ -221,6 +225,7 @@ module.exports = {
'no-sync': 'off', // disallow use of synchronous methods (off by default)
'eol-last': 'error',
'import/no-default-export': 'error',
'no-control-regex': 'error',

// Variables
// These rules have to do with variable declarations.
@@ -234,6 +239,7 @@ module.exports = {
'no-undefined': 'off', // disallow use of undefined variable (off by default)
'no-undef-init': 'error', // disallow use of undefined when initializing variables
'no-unused-vars': 'off',
'no-useless-escape': 'error',
'no-unused-expressions': 0,
'chai-friendly/no-unused-expressions': 2,
'@typescript-eslint/no-unused-vars': [
@@ -294,14 +300,25 @@ module.exports = {
},
],
'prefer-numeric-literals': 'error',
'no-unsafe-optional-chaining': 'error',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'return' },
],
'local-rules/no-override-ds-component': ['error', { packageName: '@trezor/components' }],
'local-rules/no-override-ds-component': [
'error',
{ packageName: '@trezor/product-components' },
{ packageNames: ['@trezor/product-components', '@trezor/components'] },
],

// Jest plugin config
'jest/valid-title': 'off', // This rule does not use Typescript and produces false positives
'jest/valid-describe-callback': 'off', // This rule does not use Typescript and produces false positives
'jest/no-disabled-tests': 'off', // we still have a lot of skipped tests (WIP)
'jest/no-conditional-expect': 'off', // Todo: we shall solve this, this is bad practice
'jest/expect-expect': 'off', // Todo: we have test with no assertions, this may be legit but it needs to be checked
'jest/no-standalone-expect': [
'error',
{ additionalTestBlockFunctions: ['conditionalTest'] },
],
},
overrides: [
@@ -344,12 +361,9 @@ module.exports = {
rules: {
'@typescript-eslint/no-shadow': 'off',
'import/no-default-export': 'off',
'import/order': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-console': 'off',
'react/jsx-no-undef': 'off',
'no-catch-shadow': 'off',
'@typescript-eslint/no-restricted-imports': 'off',
'no-restricted-syntax': 'off',
},
},
@@ -369,5 +383,17 @@ module.exports = {
'import/no-default-export': 'off',
},
},
{
files: ['packages/suite-web/e2e/**/*'],
rules: {
'jest/valid-expect': 'off', // Cypress
},
},
{
files: ['packages/connect/e2e/**/*'],
rules: {
'jest/no-jasmine-globals': 'off', // Karma tests
},
},
],
};
4 changes: 2 additions & 2 deletions .github/workflows/build-suite-native-preview.yml
Original file line number Diff line number Diff line change
@@ -53,8 +53,8 @@ jobs:
RUNTIME_VERSION=$(npx expo config --json | jq -r '.runtimeVersion')
echo "Current runtimeVersion is $RUNTIME_VERSION"
# Check if there is a build with the same runtimeVersion on EAS already
EXISTING_BUILD=$(eas build:list --status=finished --build-profile=preview --channel=preview --limit=1 --non-interactive --runtime-version=$RUNTIME_VERSION)
if [ -z "$EXISTING_BUILD" ]; then
EXISTING_BUILD=$(eas build:list --status=finished --build-profile=preview --channel=preview --limit=1 --non-interactive --json --runtime-version=$RUNTIME_VERSION)
if [ "$EXISTING_BUILD" = "[]" ]; then
echo "No build with runtimeVersion $RUNTIME_VERSION found"
echo "RUNTIME_BUILD_EXISTS=false" >> $GITHUB_ENV
else
4 changes: 2 additions & 2 deletions .github/workflows/test-connect.yml
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ jobs:

- name: Set other devices matrix
id: set-matrix-other-devices
run: echo "otherDevicesMatrix=$(node ./scripts/ci/connect-test-matrix-generator.js --model=all --firmware=2-latest --env=node --groups=api --cache_tx=true --transport=Bridge)" >> $GITHUB_OUTPUT
run: echo "otherDevicesMatrix=$(node ./scripts/ci/connect-test-matrix-generator.js --model=all --firmware=2-main --env=node --groups=api --cache_tx=true --transport=Bridge)" >> $GITHUB_OUTPUT

PR-check:
needs: [build, set-matrix]
@@ -173,7 +173,7 @@ jobs:
testPattern: ${{ matrix.groups.pattern }}
includeFilter: ${{ matrix.groups.includeFilter }}
testsFirmware: ${{ matrix.firmware }}
testDescription: ${{ matrix.model }}
testDescription: ${{ matrix.model }}-${{ matrix.firmware }}
cache_tx: ${{ matrix.cache_tx }}
transport: ${{ matrix.transport }}
testEnv: ${{ matrix.env }}
1 change: 1 addition & 0 deletions .github/workflows/test-suite-web-e2e.yml
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ on:
- ".github/workflows/release*"
- ".github/workflows/template*"
- ".github/actions/release*/**"
workflow_dispatch:

env:
DEV_SERVER_URL: "https://dev.suite.sldev.cz"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ Development is not possible on Windows. This can be circumvented by tools such a
### Getting started

- `git clone git@github.com:trezor/trezor-suite.git`
- `cd trezor-suite`
- `git submodule update --init --recursive`
- `git lfs install` // Set up Git LFS for your user account. You only need to run this once per user account.
- `git lfs pull`
2 changes: 1 addition & 1 deletion docker/docker-compose.connect-popup-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
trezor-user-env-unix:
image: ghcr.io/trezor/trezor-user-env:766f7d2cd13635fbdb61afa569f6aeb927085bf1
image: ghcr.io/trezor/trezor-user-env:c637c2f58e799284f6019481fa0de30457bd6b60
environment:
- SDL_VIDEODRIVER=dummy
- XDG_RUNTIME_DIR=/var/tmp
2 changes: 1 addition & 1 deletion docker/docker-compose.connect-popup-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
trezor-user-env-unix:
image: ghcr.io/trezor/trezor-user-env:766f7d2cd13635fbdb61afa569f6aeb927085bf1
image: ghcr.io/trezor/trezor-user-env:c637c2f58e799284f6019481fa0de30457bd6b60
environment:
- DISPLAY=$DISPLAY
- QT_X11_NO_MITSHM=1
2 changes: 1 addition & 1 deletion docker/docker-compose.connect-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
trezor-user-env-unix:
image: ghcr.io/trezor/trezor-user-env:766f7d2cd13635fbdb61afa569f6aeb927085bf1
image: ghcr.io/trezor/trezor-user-env:c637c2f58e799284f6019481fa0de30457bd6b60
environment:
- SDL_VIDEODRIVER=dummy
- XDG_RUNTIME_DIR=/var/tmp
2 changes: 1 addition & 1 deletion docker/docker-compose.connect-webextension-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
trezor-user-env-unix:
image: ghcr.io/trezor/trezor-user-env:766f7d2cd13635fbdb61afa569f6aeb927085bf1
image: ghcr.io/trezor/trezor-user-env:c637c2f58e799284f6019481fa0de30457bd6b60
environment:
- SDL_VIDEODRIVER=dummy
- XDG_RUNTIME_DIR=/var/tmp
2 changes: 1 addition & 1 deletion docker/docker-compose.suite-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
trezor-user-env-unix:
image: ghcr.io/trezor/trezor-user-env:766f7d2cd13635fbdb61afa569f6aeb927085bf1
image: ghcr.io/trezor/trezor-user-env:c637c2f58e799284f6019481fa0de30457bd6b60
environment:
- SDL_VIDEODRIVER=dummy
- XDG_RUNTIME_DIR=/var/tmp
2 changes: 1 addition & 1 deletion docker/docker-compose.suite-desktop-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
trezor-user-env-unix:
image: ghcr.io/trezor/trezor-user-env:766f7d2cd13635fbdb61afa569f6aeb927085bf1
image: ghcr.io/trezor/trezor-user-env:c637c2f58e799284f6019481fa0de30457bd6b60
environment:
- SDL_VIDEODRIVER=dummy
- XDG_RUNTIME_DIR=/var/tmp
2 changes: 1 addition & 1 deletion docker/docker-compose.suite-dev.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
version: "3.9"
services:
trezor-user-env-unix:
image: ghcr.io/trezor/trezor-user-env:766f7d2cd13635fbdb61afa569f6aeb927085bf1
image: ghcr.io/trezor/trezor-user-env:c637c2f58e799284f6019481fa0de30457bd6b60
environment:
- DISPLAY=$DISPLAY
- QT_X11_NO_MITSHM=1
2 changes: 1 addition & 1 deletion docker/docker-compose.suite-native-ci.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ services:
trezor-user-env-unix:
network_mode: "host"
container_name: trezor-user-env.unix
image: ghcr.io/trezor/trezor-user-env:766f7d2cd13635fbdb61afa569f6aeb927085bf1
image: ghcr.io/trezor/trezor-user-env:c637c2f58e799284f6019481fa0de30457bd6b60
environment:
- SDL_VIDEODRIVER=dummy
- XDG_RUNTIME_DIR=/var/tmp
2 changes: 1 addition & 1 deletion docker/docker-compose.suite-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
trezor-user-env-unix:
image: ghcr.io/trezor/trezor-user-env:766f7d2cd13635fbdb61afa569f6aeb927085bf1
image: ghcr.io/trezor/trezor-user-env:c637c2f58e799284f6019481fa0de30457bd6b60
environment:
- DISPLAY=$DISPLAY
- QT_X11_NO_MITSHM=1
2 changes: 1 addition & 1 deletion docker/docker-compose.transport-test-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.9"
services:
trezor-user-env-unix:
image: ghcr.io/trezor/trezor-user-env:766f7d2cd13635fbdb61afa569f6aeb927085bf1
image: ghcr.io/trezor/trezor-user-env:c637c2f58e799284f6019481fa0de30457bd6b60
environment:
- SDL_VIDEODRIVER=dummy
- XDG_RUNTIME_DIR=/var/tmp
41 changes: 0 additions & 41 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -21,47 +21,6 @@
- [events](./packages/connect/events.md)
- [path](./packages/connect/path.md)
- [methods](./packages/connect/methods.md)
- [common parameters](./packages/connect/methods/commonParams.md)
- [getPublicKey](./packages/connect/methods/getPublicKey.md)
- [requestLogin](./packages/connect/methods/requestLogin.md)
- [cipherKeyValue](./packages/connect/methods/cipherKeyValue.md)
- [wipeDevice](./packages/connect/methods/wipeDevice.md)
- [resetDevice](./packages/connect/methods/resetDevice.md)
- [getCoinInfo](./packages/connect/methods/getCoinInfo.md)
- [getAddress](./packages/connect/methods/getAddress.md)
- [getAccountInfo](./packages/connect/methods/getAccountInfo.md)
- [getOwnershipId](./packages/connect/methods/getOwnershipId.md)
- [getOwnershipProof](./packages/connect/methods/getOwnershipProof.md)
- [composeTransaction](./packages/connect/methods/composeTransaction.md)
- [signTransaction](./packages/connect/methods/signTransaction.md)
- [pushTransaction](./packages/connect/methods/pushTransaction.md)
- [signMessage](./packages/connect/methods/signMessage.md)
- [verifyMessage](./packages/connect/methods/verifyMessage.md)
- [authorizeCoinjoin](./packages/connect/methods/authorizeCoinjoin.md)
- [ethereumGetAddress](./packages/connect/methods/ethereumGetAddress.md)
- [ethereumSignTransaction](./packages/connect/methods/ethereumSignTransaction.md)
- [ethereumSignMessage](./packages/connect/methods/ethereumSignMessage.md)
- [ethereumSignTypedData](./packages/connect/methods/ethereumSignTypedData.md)
- [ethereumVerifyMessage](./packages/connect/methods/ethereumVerifyMessage.md)
- [eosGetPublicKey](./packages/connect/methods/eosGetPublicKey.md)
- [eosSignTransaction](./packages/connect/methods/eosSignTransaction.md)
- [nemGetAddress](./packages/connect/methods/nemGetAddress.md)
- [nemSignTransaction](./packages/connect/methods/nemSignTransaction.md)
- [stellarGetAddress](./packages/connect/methods/stellarGetAddress.md)
- [stellarSignTransaction](./packages/connect/methods/stellarSignTransaction.md)
- [cardanoGetPublicKey](./packages/connect/methods/cardanoGetPublicKey.md)
- [cardanoGetAddress](./packages/connect/methods/cardanoGetAddress.md)
- [cardanoSignTransaction](./packages/connect/methods/cardanoSignTransaction.md)
- [rippleGetAddress](./packages/connect/methods/rippleGetAddress.md)
- [rippleSignTransaction](./packages/connect/methods/rippleSignTransaction.md)
- [tezosGetAddress](./packages/connect/methods/tezosGetAddress.md)
- [tezosGetPublicKey](./packages/connect/methods/tezosGetPublicKey.md)
- [tezosSignTransaction](./packages/connect/methods/tezosSignTransaction.md)
- [binanceGetAddress](./packages/connect/methods/binanceGetAddress.md)
- [binanceGetPublicKey](./packages/connect/methods/binanceGetPublicKey.md)
- [binanceSignTransaction](./packages/connect/methods/binanceSignTransaction.md)
- [firmwareUpdate](./packages/connect/methods/firmwareUpdate.md)
- [getFirmwareHash](./packages/connect/methods/getFirmwareHash.md)
- [@trezor/suite](./packages/suite/index.md)
- [send form](./packages/suite/send.md)
- [send form architecture](./packages/suite/send/ARCHITECTURE.md)
2 changes: 2 additions & 0 deletions docs/misc/index.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ At any time, information stored here might be restructured or moved to a differe
location, so as to ensure that the documentation is well structured overall.

- [build](./build.md)
- [development on Windows](./development-on-windows.md)
- [device naming](./device-naming.md)
- [review](./review.md)
- [suite setup troubleshooting](./suite-setup-troubleshooting.md)
- [videos](./videos.md)
44 changes: 28 additions & 16 deletions eslint-local-rules/rules.ts
Original file line number Diff line number Diff line change
@@ -19,31 +19,36 @@ export default {
{
type: 'object',
properties: {
packageName: {
type: 'string',
packageNames: {
type: 'array',
items: { type: 'string' },
minItems: 1,
},
},
additionalProperties: false,
},
],
},
create(context) {
const packageName = context.options[0] && context.options[0].packageName;
if (!packageName) {
const packageNames = context.options[0]?.packageNames || [];
if (packageNames.length === 0) {
return {};
}

const importedComponents = new Set();
const importedComponents = new Map<string, Set<string>>(); // Map to store components per package name

return {
ImportDeclaration(node) {
if (node.source.value === packageName) {
if (packageNames.includes(node.source.value)) {
node.specifiers.forEach(specifier => {
if (
specifier.type === 'ImportSpecifier' ||
specifier.type === 'ImportDefaultSpecifier'
) {
importedComponents.add(specifier.local.name);
if (!importedComponents.has(node.source.value)) {
importedComponents.set(node.source.value, new Set<string>());
}
importedComponents.get(node.source.value).add(specifier.local.name);
}
});
}
@@ -52,16 +57,23 @@ export default {
if (
node.tag.type === 'CallExpression' &&
node.tag.callee.name === 'styled' &&
node.tag.arguments[0].type === 'Identifier' &&
importedComponents.has(node.tag.arguments[0].name)
node.tag.arguments[0].type === 'Identifier'
) {
context.report({
node,
messageId: 'avoidStyledComponent',
data: {
packageName,
},
});
const componentName = node.tag.arguments[0].name;

// Check if component name matches any imported component from the specified packages
for (const [pkgName, components] of importedComponents) {
if (components.has(componentName)) {
context.report({
node,
messageId: 'avoidStyledComponent',
data: {
packageName: pkgName,
},
});
break;
}
}
}
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@
"type-fest": "4.24.0",
"bcrypto": "5.4.0",
"react": "18.2.0",
"electron": "33.0.2",
"electron": "33.1.0",
"@types/node": "20.12.7",
"@types/react": "18.2.55",
"bn.js": "5.2.1"
3 changes: 2 additions & 1 deletion packages/analytics/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { Environment } from '@trezor/env-utils';
import type { App, Event as AnalyticsEvent } from './types';
import { getWeakRandomId } from '@trezor/utils';

import type { App, Event as AnalyticsEvent } from './types';

export const getTrackingRandomId = () => getWeakRandomId(10);

export const getRandomId = () => getWeakRandomId(10);
2 changes: 1 addition & 1 deletion packages/blockchain-link/package.json
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@
"html-webpack-plugin": "^5.6.0",
"tiny-worker": "^2.3.0",
"tsx": "^4.16.3",
"webpack": "^5.94.0",
"webpack": "^5.96.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4",
"worker-loader": "^3.0.8"
2 changes: 1 addition & 1 deletion packages/blockchain-link/src/index.ts
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ const initWorker = async (settings: BlockchainSettings) => {
worker.onerror = null;
try {
worker.terminate();
} catch (error) {
} catch {
// empty
}

Loading