Skip to content

Commit

Permalink
Merge branch 'develop' into remove-unused-code
Browse files Browse the repository at this point in the history
  • Loading branch information
davibroc authored Oct 11, 2024
2 parents fda3ee0 + e4c71b7 commit a8e6bd9
Show file tree
Hide file tree
Showing 23 changed files with 732 additions and 615 deletions.
57 changes: 0 additions & 57 deletions .yarn/patches/@trezor-connect-web-npm-9.3.0-040ab10d9a.patch

This file was deleted.

2 changes: 1 addition & 1 deletion app/manifest/v2/_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"all_frames": true
},
{
"matches": ["*://connect.trezor.io/*/popup.html"],
"matches": ["*://connect.trezor.io/*/popup.html*"],
"js": ["vendor/trezor/content-script.js"]
}
],
Expand Down
2 changes: 1 addition & 1 deletion app/manifest/v3/_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"all_frames": true
},
{
"matches": ["*://connect.trezor.io/*/popup.html"],
"matches": ["*://connect.trezor.io/*/popup.html*"],
"js": ["vendor/trezor/content-script.js"]
}
],
Expand Down
73 changes: 34 additions & 39 deletions lavamoat/build-system/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@
"@babel/core": true,
"@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports": true,
"@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access": true,
"depcheck>@babel/traverse>@babel/helper-environment-visitor": true,
"depcheck>@babel/traverse>@babel/helper-split-export-declaration": true,
"depcheck>@babel/traverse": true,
"lavamoat>@babel/highlight>@babel/helper-validator-identifier": true
}
},
Expand Down Expand Up @@ -478,7 +477,7 @@
"@babel/preset-env>@babel/helper-plugin-utils": true,
"@babel/preset-env>@babel/plugin-syntax-async-generators": true,
"@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator": true,
"depcheck>@babel/traverse>@babel/helper-environment-visitor": true
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-environment-visitor": true
}
},
"@babel/preset-env>@babel/plugin-transform-async-to-generator": {
Expand All @@ -494,14 +493,14 @@
"@babel/core": true,
"@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator>@babel/helper-wrap-function": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true,
"depcheck>@babel/traverse>@babel/helper-environment-visitor": true
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-environment-visitor": true
}
},
"@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator>@babel/helper-wrap-function": {
"packages": {
"@babel/core>@babel/template": true,
"@babel/core>@babel/types": true,
"depcheck>@babel/traverse>@babel/helper-function-name": true
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-function-name": true
}
},
"@babel/preset-env>@babel/plugin-transform-block-scoped-functions": {
Expand Down Expand Up @@ -535,19 +534,25 @@
"@babel/core>@babel/helper-compilation-targets": true,
"@babel/preset-env>@babel/helper-plugin-utils": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-environment-visitor": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-function-name": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-optimise-call-expression": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers": true,
"@babel/preset-env>@babel/plugin-transform-classes>globals": true,
"depcheck>@babel/traverse>@babel/helper-environment-visitor": true,
"depcheck>@babel/traverse>@babel/helper-function-name": true,
"depcheck>@babel/traverse>@babel/helper-split-export-declaration": true
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-split-export-declaration": true,
"@babel/preset-env>@babel/plugin-transform-classes>globals": true
}
},
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": {
"packages": {
"@babel/core>@babel/types": true
}
},
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-function-name": {
"packages": {
"@babel/core>@babel/template": true,
"@babel/core>@babel/types": true
}
},
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-optimise-call-expression": {
"packages": {
"@babel/core>@babel/types": true
Expand All @@ -558,14 +563,19 @@
"@babel/core": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-optimise-call-expression": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions": true,
"depcheck>@babel/traverse>@babel/helper-environment-visitor": true
"depcheck>@babel/traverse": true
}
},
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions": {
"packages": {
"@babel/core>@babel/types": true
}
},
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-split-export-declaration": {
"packages": {
"@babel/core>@babel/types": true
}
},
"@babel/preset-env>@babel/plugin-transform-computed-properties": {
"packages": {
"@babel/core": true,
Expand Down Expand Up @@ -673,7 +683,7 @@
"packages": {
"@babel/core>@babel/helper-compilation-targets": true,
"@babel/preset-env>@babel/helper-plugin-utils": true,
"depcheck>@babel/traverse>@babel/helper-function-name": true
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-function-name": true
}
},
"@babel/preset-env>@babel/plugin-transform-json-strings": {
Expand Down Expand Up @@ -716,10 +726,15 @@
"@babel/core": true,
"@babel/core>@babel/helper-module-transforms": true,
"@babel/preset-env>@babel/helper-plugin-utils": true,
"depcheck>@babel/traverse>@babel/helper-hoist-variables": true,
"@babel/preset-env>@babel/plugin-transform-modules-systemjs>@babel/helper-hoist-variables": true,
"lavamoat>@babel/highlight>@babel/helper-validator-identifier": true
}
},
"@babel/preset-env>@babel/plugin-transform-modules-systemjs>@babel/helper-hoist-variables": {
"packages": {
"@babel/core>@babel/types": true
}
},
"@babel/preset-env>@babel/plugin-transform-modules-umd": {
"builtin": {
"path.basename": true,
Expand Down Expand Up @@ -811,9 +826,7 @@
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions": true,
"@babel/preset-env>@babel/plugin-transform-private-methods>@babel/helper-create-class-features-plugin>semver": true,
"@babel/preset-env>@babel/plugin-transform-spread>@babel/helper-skip-transparent-expression-wrappers": true,
"depcheck>@babel/traverse>@babel/helper-environment-visitor": true,
"depcheck>@babel/traverse>@babel/helper-function-name": true,
"depcheck>@babel/traverse>@babel/helper-split-export-declaration": true
"depcheck>@babel/traverse": true
}
},
"@babel/preset-env>@babel/plugin-transform-private-methods>@babel/helper-create-class-features-plugin>semver": {
Expand Down Expand Up @@ -1042,6 +1055,7 @@
"@babel/preset-env>@babel/helper-plugin-utils": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": true,
"@babel/preset-env>@babel/plugin-transform-private-methods>@babel/helper-create-class-features-plugin": true,
"@babel/preset-env>@babel/plugin-transform-spread>@babel/helper-skip-transparent-expression-wrappers": true,
"@babel/preset-typescript>@babel/plugin-transform-typescript>@babel/plugin-syntax-typescript": true
}
},
Expand Down Expand Up @@ -2346,32 +2360,13 @@
"@babel/code-frame": true,
"@babel/core>@babel/generator": true,
"@babel/core>@babel/parser": true,
"@babel/core>@babel/template": true,
"@babel/core>@babel/types": true,
"babel/preset-env>b@babel/types": true,
"depcheck>@babel/traverse>@babel/helper-environment-visitor": true,
"depcheck>@babel/traverse>@babel/helper-function-name": true,
"depcheck>@babel/traverse>@babel/helper-hoist-variables": true,
"depcheck>@babel/traverse>@babel/helper-split-export-declaration": true,
"depcheck>@babel/traverse>globals": true,
"nock>debug": true
}
},
"depcheck>@babel/traverse>@babel/helper-function-name": {
"packages": {
"@babel/core>@babel/template": true,
"@babel/core>@babel/types": true
}
},
"depcheck>@babel/traverse>@babel/helper-hoist-variables": {
"packages": {
"@babel/core>@babel/types": true
}
},
"depcheck>@babel/traverse>@babel/helper-split-export-declaration": {
"packages": {
"@babel/core>@babel/types": true
}
},
"depcheck>cosmiconfig>parse-json": {
"packages": {
"@babel/code-frame": true,
Expand Down Expand Up @@ -6333,10 +6328,10 @@
"packages": {
"@babel/code-frame": true,
"@babel/core>@babel/generator": true,
"depcheck>@babel/traverse>@babel/helper-environment-visitor": true,
"depcheck>@babel/traverse>@babel/helper-function-name": true,
"depcheck>@babel/traverse>@babel/helper-hoist-variables": true,
"depcheck>@babel/traverse>@babel/helper-split-export-declaration": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-environment-visitor": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-function-name": true,
"@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-split-export-declaration": true,
"@babel/preset-env>@babel/plugin-transform-modules-systemjs>@babel/helper-hoist-variables": true,
"lavamoat-viz>lavamoat-core>lavamoat-tofu>@babel/traverse>@babel/parser": true,
"lavamoat-viz>lavamoat-core>lavamoat-tofu>@babel/traverse>@babel/types": true,
"lavamoat-viz>lavamoat-core>lavamoat-tofu>@babel/traverse>globals": true,
Expand Down
2 changes: 1 addition & 1 deletion offscreen/scripts/trezor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function init() {

TrezorConnectSDK.init({
...msg.params,
env: 'web',
env: 'webextension',
}).then(() => {
sendResponse();
});
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@
"@babel/runtime@npm:^7.8.4": "patch:@babel/runtime@npm%3A7.24.0#~/.yarn/patches/@babel-runtime-npm-7.24.0-7eb1dd11a2.patch",
"@spruceid/siwe-parser@npm:1.1.3": "patch:@spruceid/siwe-parser@npm%3A2.1.0#~/.yarn/patches/@spruceid-siwe-parser-npm-2.1.0-060b7ede7a.patch",
"@spruceid/siwe-parser@npm:2.1.0": "patch:@spruceid/siwe-parser@npm%3A2.1.0#~/.yarn/patches/@spruceid-siwe-parser-npm-2.1.0-060b7ede7a.patch",
"@trezor/connect-web@npm:^9.2.2": "patch:@trezor/connect-web@npm%3A9.2.2#~/.yarn/patches/@trezor-connect-web-npm-9.2.2-a4de8e45fc.patch",
"ts-mixer@npm:^6.0.3": "patch:ts-mixer@npm%3A6.0.4#~/.yarn/patches/ts-mixer-npm-6.0.4-5d9747bdf5.patch",
"sucrase@npm:3.34.0": "^3.35.0",
"@expo/config/glob": "^10.3.10",
Expand All @@ -262,7 +261,6 @@
"@metamask/message-manager": "^10.1.0",
"@metamask/gas-fee-controller@npm:^15.1.1": "patch:@metamask/gas-fee-controller@npm%3A15.1.2#~/.yarn/patches/@metamask-gas-fee-controller-npm-15.1.2-db4d2976aa.patch",
"@metamask/nonce-tracker@npm:^5.0.0": "patch:@metamask/nonce-tracker@npm%3A5.0.0#~/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch",
"@trezor/connect-web@npm:^9.1.11": "patch:@trezor/connect-web@npm%3A9.3.0#~/.yarn/patches/@trezor-connect-web-npm-9.3.0-040ab10d9a.patch",
"@metamask/network-controller@npm:^17.0.0": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch",
"@metamask/network-controller@npm:^19.0.0": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch",
"@metamask/network-controller@npm:^20.0.0": "patch:@metamask/network-controller@npm%3A21.0.0#~/.yarn/patches/@metamask-network-controller-npm-21.0.0-559aa8e395.patch",
Expand Down Expand Up @@ -371,7 +369,7 @@
"@sentry/types": "^8.33.1",
"@sentry/utils": "^8.33.1",
"@swc/core": "1.4.11",
"@trezor/connect-web": "patch:@trezor/connect-web@npm%3A9.3.0#~/.yarn/patches/@trezor-connect-web-npm-9.3.0-040ab10d9a.patch",
"@trezor/connect-web": "^9.4.0",
"@zxing/browser": "^0.1.4",
"@zxing/library": "0.20.0",
"await-semaphore": "^0.1.1",
Expand Down
7 changes: 5 additions & 2 deletions test/e2e/accounts/snap-account-contract-interaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import {
ACCOUNT_2,
} from '../helpers';
import FixtureBuilder from '../fixture-builder';
import { installSnapSimpleKeyring } from '../page-objects/flows/snap-simple-keyring.flow';
import { loginWithBalanceValidation } from '../page-objects/flows/login.flow';
import { SMART_CONTRACTS } from '../seeder/smart-contracts';
import { installSnapSimpleKeyring, importKeyAndSwitch } from './common';
import { importKeyAndSwitch } from './common';

describe('Snap Account Contract interaction', function () {
const smartContract = SMART_CONTRACTS.PIGGYBANK;
Expand Down Expand Up @@ -43,7 +45,8 @@ describe('Snap Account Contract interaction', function () {
ganacheServer,
}: TestSuiteArguments) => {
// Install Snap Simple Keyring and import key
await installSnapSimpleKeyring(driver, false);
await loginWithBalanceValidation(driver, ganacheServer);
await installSnapSimpleKeyring(driver);
await importKeyAndSwitch(driver);

// Open DApp with contract
Expand Down
15 changes: 12 additions & 3 deletions test/e2e/accounts/snap-account-eth-swap.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { withFixtures, defaultGanacheOptions, WINDOW_TITLES } from '../helpers';
import { Driver } from '../webdriver/driver';
import FixtureBuilder from '../fixture-builder';
import { Ganache } from '../seeder/ganache';
import {
buildQuote,
reviewQuote,
waitForTransactionToComplete,
checkActivityTransaction,
} from '../tests/swaps/shared';
import { TRADES_API_MOCK_RESULT } from '../../data/mock-data';
import { installSnapSimpleKeyring } from '../page-objects/flows/snap-simple-keyring.flow';
import { loginWithBalanceValidation } from '../page-objects/flows/login.flow';
import { Mockttp } from '../mock-e2e';
import { installSnapSimpleKeyring } from './common';

const DAI = 'DAI';
const TEST_ETH = 'TESTETH';
Expand All @@ -34,8 +36,15 @@ describe('Snap Account - Swap', function () {
title: this.test?.fullTitle(),
testSpecificMock: mockSwapsTransactionQuote,
},
async ({ driver }: { driver: Driver }) => {
await installSnapSimpleKeyring(driver, false);
async ({
driver,
ganacheServer,
}: {
driver: Driver;
ganacheServer?: Ganache;
}) => {
await loginWithBalanceValidation(driver, ganacheServer);
await installSnapSimpleKeyring(driver);
await driver.switchToWindowWithTitle(
WINDOW_TITLES.ExtensionInFullScreenView,
);
Expand Down
Loading

0 comments on commit a8e6bd9

Please sign in to comment.