Skip to content

Commit

Permalink
fix: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirvolek committed Jan 3, 2025
2 parents e581dc0 + b6de9c9 commit b2b1418
Show file tree
Hide file tree
Showing 510 changed files with 8,379 additions and 5,327 deletions.
1 change: 0 additions & 1 deletion .easignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ packages/suite-analytics/
packages/suite-build/
packages/suite-data/
packages/suite-desktop/
packages/suite-desktop-api/
packages/suite-desktop-core/
packages/suite-desktop-ui/
packages/suite-storage/
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/check-project-assignment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "[Check] Project/Issue Assignment"

on:
pull_request:
types:
- opened
- ready_for_review
- labeled
- synchronize

jobs:
check-project-or-issue:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check if PR is assigned to a project or an issue
env:
GITHUB_TOKEN: ${{ secrets.TREZOR_BOT_TOKEN }}
run: |
# Fetch PR labels
PR_LABELS=$(gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name')
# Check for "no-project" label
if echo "$PR_LABELS" | grep -q "^no-project$"; then
echo "Pass: The PR has the 'no-project' label."
exit 0
fi
# Check for linked issues using GraphQL
LINKED_ISSUES=$(gh api graphql -f query='
query($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $number) {
closingIssuesReferences(first: 10) {
nodes {
id
}
}
}
}
}' -F owner=${{ github.repository_owner }} -F repo=${{ github.event.repository.name }} -F number=${{ github.event.pull_request.number }} --jq '.data.repository.pullRequest.closingIssuesReferences.nodes | length')
if [ "$LINKED_ISSUES" -gt 0 ]; then
echo "Pass: The PR is linked to $LINKED_ISSUES issue(s)."
exit 0
fi
# Check for associated projects
PROJECT_COUNT=$(gh pr view ${{ github.event.pull_request.number }} --json projectItems --jq '.projectItems | length')
if [ "$PROJECT_COUNT" -gt 0 ]; then
echo "Pass: This PR is assigned to a project."
exit 0
fi
# If no condition passes
echo "Error: This PR is not assigned to any project, not linked to a valid issue, and does not have the 'no-project' label."
echo "Please assign the PR to a project or link it to an issue. Alternatively, add the 'no-project' label if not applicable."
exit 1
4 changes: 4 additions & 0 deletions .github/workflows/release-suite-definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ jobs:
yarn nfts simple binance-smart-chain jws
yarn nfts simple optimistic-ethereum jws
yarn nfts simple base jws
yarn nfts simple arbitrum-one jws
yarn coins simple ethereum jws
yarn coins simple ethereum-classic jws
yarn coins simple polygon-pos jws
yarn coins simple binance-smart-chain jws
yarn coins simple optimistic-ethereum jws
yarn coins simple base jws
yarn coins simple arbitrum-one jws
yarn coins simple cardano jws
yarn coins simple solana jws
yarn coins advanced solana json
Expand All @@ -70,12 +72,14 @@ jobs:
yarn nfts simple binance-smart-chain jws
yarn nfts simple optimistic-ethereum jws
yarn nfts simple base jws
yarn nfts simple arbitrum-one jws
yarn coins simple ethereum jws
yarn coins simple ethereum-classic jws
yarn coins simple polygon-pos jws
yarn coins simple binance-smart-chain jws
yarn coins simple optimistic-ethereum jws
yarn coins simple base jws
yarn coins simple arbitrum-one jws
yarn coins simple cardano jws
yarn coins simple solana jws
yarn coins advanced solana json
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release-suite-native-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ jobs:
- name: Install libs
run: yarn workspaces focus @suite-native/app
- name: Build on EAS Android
run: eas build
--platform android
--profile productionAPK
--non-interactive
--message ${{ github.sha }}
run: |
BUILD_ID=$(eas build --platform android --profile productionAPK --non-interactive --message ${{ github.sha }} --wait --json | jq -r '.[0].id')
echo "BUILD_ID: $BUILD_ID"
BUILD_URL=$(eas build:view "$BUILD_ID" --json | jq -r '.artifacts.buildUrl')
echo "BUILD_URL: $BUILD_URL"
working-directory: suite-native/app
4 changes: 4 additions & 0 deletions .github/workflows/test-blockchain-link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
pull_request:
paths:
- "packages/blockchain-link"
- "packages/blockchain-link-utils"
- "packages/blockchain-link-types"
- "packages/e2e-utils/src/fixtures/blockbook.ts"
- "packages/e2e-utils/src/mocks/backendServer.ts"
# dependencies of packages/blockchain-link
- "packages/utxo-lib"
- "packages/utils"
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/test-misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,19 @@ jobs:
- run: yarn install --immutable
- run: yarn message-system-sign-config
- run: yarn test:unit

utility-scripts:
runs-on: ubuntu-latest
if: github.repository == 'trezor/trezor-suite'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- run: yarn install --immutable
- run: yarn generate-package @trezor/meow-package
- run: rm -rf packages/meow-package
14 changes: 7 additions & 7 deletions .github/workflows/test-suite-desktop-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ on:
jobs:
run-desktop-tests:
if: github.repository == 'trezor/trezor-suite'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
# - TEST_GROUP: "@group=suite"
# CONTAINERS: "trezor-user-env-unix"
# - TEST_GROUP: "@group=device-management"
# CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=suite"
CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=device-management"
CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=settings"
CONTAINERS: "trezor-user-env-unix electrum-regtest"
# - TEST_GROUP: "@group=metadata"
# CONTAINERS: "trezor-user-env-unix"
# - TEST_GROUP: "@group=passphrase"
# CONTAINERS: "trezor-user-env-unix"
# - TEST_GROUP: "@group=other"
# CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=other"
CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=wallet"
CONTAINERS: "trezor-user-env-unix"

Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/test-suite-web-e2e-pw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ on:
- ".github/workflows/release*"
- ".github/workflows/template*"
- ".github/actions/release*/**"
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

env:
Expand Down Expand Up @@ -93,18 +95,18 @@ jobs:
fail-fast: false
matrix:
include:
# - TEST_GROUP: "@group=suite"
# CONTAINERS: "trezor-user-env-unix"
# - TEST_GROUP: "@group=device-management"
# CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=suite"
CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=device-management"
CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=settings"
CONTAINERS: "trezor-user-env-unix"
# - TEST_GROUP: "@group=metadata"
# CONTAINERS: "trezor-user-env-unix"
# - TEST_GROUP: "@group=passphrase"
# CONTAINERS: "trezor-user-env-unix"
# - TEST_GROUP: "@group=other"
# CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=other"
CONTAINERS: "trezor-user-env-unix"
- TEST_GROUP: "@group=wallet"
CONTAINERS: "trezor-user-env-unix bitcoin-regtest"

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-suite-web-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ jobs:
- TEST_GROUP: "@group_device-management"
CONTAINERS: "trezor-user-env-unix"
CYPRESS_USE_TREZOR_USER_ENV_BRIDGE: "1"
- TEST_GROUP: "@group_settings"
CONTAINERS: "trezor-user-env-unix"
CYPRESS_USE_TREZOR_USER_ENV_BRIDGE: "1"
- TEST_GROUP: "@group_metadata"
CONTAINERS: "trezor-user-env-unix"
CYPRESS_USE_TREZOR_USER_ENV_BRIDGE: "1"
Expand Down
11 changes: 10 additions & 1 deletion .husky/eslint.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
#!/bin/bash

GREEN='\033[0;32m'
NC='\033[0m' # No Color

if [ "$TREZOR_PRE_COMMIT_ESLINT_SKIP" == "true" ]; then
echo "Skipping eslint pre-commit hook, do: 'export TREZOR_PRE_COMMIT_ESLINT_SKIP=false' to re-enable it."
exit 0
fi

# This check will get all staged files that are *.js(x)/*.ts(x) files
# and run eslint on them and tries to fix them and re-add them to be committed.
# If auto-fix is possible it shall be transparent for the user.
# If some error are not fixable, the script will fail and the user will have to fix them manually.

STAGED_FILES=$(git diff --cached --name-only --diff-filter=d | grep '(\.js\|\.jsx$\|\.ts\|\.tsx)$')

echo -e "${GREEN}Running Eslint pre-commit hook, to disable it do: 'export TREZOR_PRE_COMMIT_ESLINT_SKIP=true'.${NC}"

# Exit if no files. Passing no arguments would trigger eslint for whole repo
if [ -z "$STAGED_FILES" ]; then
echo "No staged JavaScript/TypeScript files to lint."
else
echo "Linting JavaScript/TypeScript files..."
echo "$STAGED_FILES"
echo ""

Expand Down
1 change: 0 additions & 1 deletion jest.config.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ module.exports = {
'<rootDir>/../../node_modules/react-native-gesture-handler/jestSetup.js',
'<rootDir>/../../suite-native/test-utils/src/atomsMock.js',
'<rootDir>/../../suite-native/test-utils/src/expoMock.js',
'<rootDir>/../../suite-native/test-utils/src/walletSdkMock.js',
],
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
"node-gyp": "10.2.0",
"reselect": "5.1.1",
"### We need promise to be same version in mobile unless it produces undefined behavior, check PR #15815": "1.0.0",
"promise": "8.3.0"
"promise": "8.3.0",
"@everstake/wallet-sdk/@solana/web3.js": "1.95.8"
},
"devDependencies": {
"@babel/cli": "^7.23.9",
Expand Down
7 changes: 6 additions & 1 deletion packages/address-validator/src/currencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -1448,7 +1448,12 @@ var CURRENCIES = [
},
{
name: 'BNB Smart Chain',
symbol: 'bnb',
symbol: 'bsc',
validator: ETHValidator,
},
{
name: 'Arbitrum One',
symbol: 'arb', // TODO
validator: ETHValidator,
},
{
Expand Down
20 changes: 10 additions & 10 deletions packages/address-validator/tests/wallet_address_validator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,8 @@ describe('WAValidator.validate()', function () {
isValidAddressType('aaaaaaaaaaaaaaa000000000000000', 'siacoin', 'prod', undefined);
});

it('should return true for correct BNB addresses', function () {
valid('0x0590396689ee1d287147e9383fb8dd24532f2006', 'bnb');
it('should return true for correct BSC addresses', function () {
valid('0x0590396689ee1d287147e9383fb8dd24532f2006', 'bsc');
valid('0x07fc5c2bcaa0fa6bdaa4fff897490312c8f33c27', 'BNB smart chain');
});

Expand Down Expand Up @@ -1116,12 +1116,12 @@ describe('WAValidator.validate()', function () {
});

it('should return true for correct BNB smart chain address', function () {
valid('0x7ae2f5b9e386cd1b50a4550696d957cb4900f03a', 'bnb');
valid('0x7ae2f5b9e386cd1b50a4550696d957cb4900f03a', 'bsc');
valid('0x0000000000000000000000000000000000001000', 'BNB Smart Chain');
});

it('should return false for incorrect BNB smart chain address', function () {
invalid('bnb1xlvns0n2mxh77mzaspn2hgav4rr4m8eerfju38', 'bnb');
invalid('bnb1xlvns0n2mxh77mzaspn2hgav4rr4m8eerfju38', 'bsc');
});

it('should return true for correct xtz(tezos) address', function () {
Expand Down Expand Up @@ -1567,13 +1567,13 @@ describe('WAValidator.validate()', function () {
invalid('g4VPBPrHZkfE8CsjuG2S4yBQNd455UWmk', 'stellar');
});

it('should return false for incorrect bnb addresses', function () {
it('should return false for incorrect bsc addresses', function () {
commonTests('bnb smart chain');
commonTests('bnb');
invalid('xrb_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjdgu', 'bnb');
invalid('nano_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjdgu', 'bnb');
invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'bnb');
invalid('nano_111111111111111111111111111111111111111111111111111hifc8npp', 'bnb');
commonTests('bsc');
invalid('xrb_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjdgu', 'bsc');
invalid('nano_1f5e4w33ndqbkx4bw5jtp13kp5xghebfxcmw9hdt1f7goid1s4373w6tjdgu', 'bsc');
invalid('xrb_1111111112111111111111111111111111111111111111111111hifc8npp', 'bsc');
invalid('nano_111111111111111111111111111111111111111111111111111hifc8npp', 'bsc');
});

it('should return false for incorrect xtz(tezos) address', function () {
Expand Down
1 change: 1 addition & 0 deletions packages/blockchain-link-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"prepublish": "yarn tsx ../../scripts/prepublish.js"
},
"dependencies": {
"@everstake/wallet-sdk": "^1.0.5",
"@solana/web3.js": "^2.0.0",
"@trezor/type-utils": "workspace:*",
"@trezor/utxo-lib": "workspace:*"
Expand Down
2 changes: 0 additions & 2 deletions packages/blockchain-link-types/src/blockbook-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ export interface Token {
secondaryValue?: number;
ids?: string[];
multiTokenValues?: MultiTokenValue[];
totalReceived?: string;
totalSent?: string;
}
export interface Address {
page?: number;
Expand Down
4 changes: 1 addition & 3 deletions packages/blockchain-link-types/src/blockbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ type BlockFiltersBatch = `${string}:${string}:${string}`[];
// XPUBAddress, ERC20, ERC721, ERC1155 - blockbook generated type (Token) is not strict enough
export type XPUBAddress = {
type: 'XPUBAddress';
} & Required<
Pick<BlockbookToken, 'path' | 'decimals' | 'balance' | 'totalSent' | 'totalReceived'>
> &
} & Required<Pick<BlockbookToken, 'path' | 'decimals' | 'balance'>> &
Pick<BlockbookToken, 'name' | 'transfers'>;

type BaseERC = Required<Pick<BlockbookToken, 'contract'>> &
Expand Down
Loading

0 comments on commit b2b1418

Please sign in to comment.