1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 03:12:42 +02:00
Commit Graph

919 Commits

Author SHA1 Message Date
Howard Braham
ed06926ac5
chore(tools): update geckodriver to 4.0.4 (#19558) 2023-06-22 21:00:40 -07:00
Elliot Winkler
89cec5335f
Replace NetworkController w/ core version (#19486)
This commit fulfills a long-standing desire to get the extension using
the same network controller as mobile by removing NetworkController from
this repo and replacing it with NetworkController from the
`@metamask/network-controller` package.

The new version of NetworkController is different the old one in a few
ways:

- The new controller inherits from BaseControllerV2, so the `state`
  property is used to access the state instead of `store.getState()`.
  All references of the latter have been replaced with the former.
- As the new controller no longer has a `store` property, it cannot be
  subscribed to; the controller takes a messenger which can be
  subscribed to instead. There were various places within
  MetamaskController where the old way of subscribing has been replaced
  with the new way. In addition, DetectTokensController has been updated
  to take a messenger object so that it can listen for NetworkController
  state changes.
- The state of the new controller is not updatable from the outside.
  This affected BackupController, which dumps state from
  NetworkController (among other controllers), but also loads the same
  state into NetworkController on import. A method `loadBackup` has been
  added to NetworkController to facilitate this use case, and
  BackupController is now using this method instead of attempting to
  call `update` on NetworkController.
- The new controller does not have a `getCurrentChainId` method;
  instead, the chain ID can be read from the provider config in state.
  This affected MmiController. (MmiController was also updated to read
  custom networks from the new network controller instead of the
  preferences controller).
- The default network that the new controller is set to is always
  Mainnet (previously it could be either localhost or Goerli in test
  mode, depending on environment variables). This has been addressed
  by feeding the NetworkController initial state using the old logic, so
  this should not apply.
2023-06-22 12:46:09 -06:00
Elliot Winkler
16dad66da9
Update Chromedriver to v114 (#19648) 2023-06-22 09:41:03 -05:00
Howard Braham
9acd4b4ea1
feat(srp): add a quiz to the SRP reveal (#19283)
* feat(srp): add a quiz to the SRP reveal

* fixed the popover header centering

* lint fixes

* converted from `ui/components/ui/popover` to `ui/components/component-library/modal`

* responded to @darkwing review

* added unit tests

* renamed the folder to 'srp-quiz-modal'

* responded to Monte's review

* using i18n-helper in the test suite

* small improvement to JSXDict comments

* wrote a new webdriver.holdMouseDownOnElement() to assist with testing the "Hold to reveal SRP" button

* Updating layout and some storybook naming and migrating to tsx

* Apply suggestions from @georgewrmarshall

Co-authored-by: George Marshall <george.marshall@consensys.net>

* Unit test searches by data-testid instead of by text

* new layout and copy for the Settings->Security page

* now with 100% test coverage for /ui/pages/settings/security-tab
fixes #16871
fixes #18140

* e2e tests to reveal SRP after quiz

* e2e- Fix lint, remove unneeded extras

* @coreyjanssen and @georgewrmarshall compromise

Co-authored-by: George Marshall <george.marshall@consensys.net>
Co-authored-by: Corey Janssen <corey.janssen@consensys.net>

* trying isRequired again

* transparent background on PNG

* [e2e] moving functions to helpers and adding testid for SRP reveal quiz (#19481)

* moving functions to helpers and adding testid

* fix lint error

* took out the IPFS gateway fixes

* lint fix

* translations of SRP Reveal Quiz

* new Spanish translation from Guto

* Update describe for e2e tests

* Apply suggestion from @georgewrmarshall

Co-authored-by: George Marshall <george.marshall@consensys.net>

* fixed the Tab key problem

---------

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
Co-authored-by: Plasma Corral <32695229+plasmacorral@users.noreply.github.com>
Co-authored-by: Corey Janssen <corey.janssen@consensys.net>
2023-06-20 14:27:10 -04:00
Alex Donesky
c6b938a89c
bump assets-controllers to v9.1.0 (#19629)
* bump assets-controllers to v9.1.0

* fix package entry
2023-06-20 11:13:43 -05:00
OGPoyraz
39089e0f4c
Accept SignController approval request from frontend (#19184) 2023-06-20 15:37:09 +02:00
Pedro Figueiredo
66c9654244
Implement tests for multiple service worker restarts on the mv3 build (#19293)
* implement multiple restart tests

* remove console.logs

* fix

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* close stale prs

* revert chromedriver version

* delete code leftover

* remove unlockWallet method

---------

Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2023-06-20 11:17:08 +01:00
Alex Donesky
c16b35c029
Extend wallet_watchAsset to support ERC721 and ERC1155 tokens (#19454)
* Extend wallet_watchAsset to support ERC721 and ERC1155 tokens
2023-06-15 15:18:12 -05:00
legobeat
00607d2298
devDeps: socketcluster-client@14.3.1->14.3.2 (#19055)
CVE-2021-32640 / GHSA-6fc8-4gx4-v693
2023-06-16 01:58:45 +09:00
legobeat
f286d16664
devDeps: bump and align devDependencies (#19194)
* devDeps: madge@^5.0.1->^6.1.0

* devDeps: dependency-tree@^8.1.2->^10.0.7

* devDeps: gh-pages@^3.2.3->^5.0.0

* devDeps: del@^3.0.0->^6.1.1

* devDeps: chalk@^3.0.0->^4.1.2

* dedupe

---------

Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2023-06-16 00:47:39 +09:00
Bernardo Garces Chapero
55a1514513
fix signature controller patch (#19607) 2023-06-15 15:12:59 +01:00
Victorien Gauch
1fca9255c1
fix: refactor linea goerli testnet implementation (#19321)
* fix: refactor linea goerli testnet implementation

* fix: rename linea goerli network

* feat: add linea testnet logo

* update linea goerli block explorer url

* update @metamask/eth-json-rpc-infura package to version 8.1.0

* fix: refactor ticker map object in shared/constants/networks.ts files
2023-06-15 09:08:07 -02:30
legobeat
bcfda8b11c
devDeps: degenerator@3.0.1->3.0.4 (#19178)
- CVE-2023-32314 / GHSA-whpj-8f3w-67p5
- CVE-2023-32313 / GHSA-p5gc-c584-jj6v
2023-06-14 13:53:12 -02:30
Mark Stacey
b43900f743
Update message manager and signature controller (#19370)
* Update message manager and signature controller

The packages `@metamask/message-manager` and
`@metamask/signature-controller` have been updated to the latest
versions. These versions were part of part of the [core monorepo v53](MetaMask/core#1385)
release. The remaining packages released as part of v53 will be updated
in later PRs.

These releases included a few breaking changes, but none that affect
the extension. Both packages now expect `getCurrentChainId` to return
`Hex`, but that was already the case here. Additionally the signature
controller now has a peer dependency on the approval controller v3,
which is already present and at the correct version.

Relates to #19271

* Ignore error caused by TS bug

* Update types to omit metadata for encryption requests

* Update lavamoat policy
2023-06-14 11:27:41 -02:30
Mark Stacey
40d1df1e0d
Update lockfile (#19583)
The lockfile was stale on `develop`; it has now been updated.
2023-06-13 13:00:48 -02:30
Mark Stacey
abd2a5559e
Update @metamask/gas-fee-controller to v6 (#19366)
* Update `@metamask/gas-fee-controller` to v6

The `@metamask/address-book-controller` package has been updated to v3.
This version was part of the [core monorepo v53](MetaMask/core#1385)
release. The remaining packages released as part of v53 will be updated
in later PRs.

This release included a number of breaking changes, but most of them
do not affect the extension:

* Bump to Node 16
  * The extension already uses Node.js v16
* The `getChainId` constructor parameter now expects a `Hex` return
type rather than a decimal string
  * The extension was already passing in a `getChainId` parameter that
returned `Hex`
* The gas fee controller messenger now requires the
`NetworkController:stateChange` event instead of the
`NetworkController:providerConfigChange` event
  * This does not apply if `onNetworkStateChange` and `getChainId` are
provided to the constructor, which is the case here.
* Update `@metamask/network-controller` dependency and peer dependency
  * This dependency is only used for types, and none of the type
changes affect how the extension interacts with this controller.

The one change that did have an impact is that the constructor
parameter `onNetworkStateChange` now expects event handlers to be
passed the full network state.

Relates to #19271

* Ensure chainid always matches mainnet in test builds

This is a bit strange, but this is how the tests were setup previously.

* Fix accidental state mutation

* Remove hardcoded mainnet chain ID from test builds
2023-06-13 12:13:13 -02:30
Frederik Bolding
be7900e9e9
[FLASK] Bump RateLimitController to v3 (#19578)
* Bump RateLimitController to latest

* Regen LavaMoat policies
2023-06-13 15:04:28 +02:00
Matthew Walsh
4f4192c6f4
Await approval request in transaction controller (#19197) 2023-06-13 10:17:32 +01:00
Elliot Winkler
f77b1f65e2
Upgrade assets-controllers to v9 (#19472) 2023-06-09 15:48:48 -05:00
Frederik Bolding
546d8349e7
Bump fast-xml-parser to fix audit issue (#19489) 2023-06-07 12:14:06 +02:00
Bernardo Garces Chapero
5355000202
Handle watch asset accept and reject using ApprovalController only (#18829) 2023-06-05 21:13:22 +01:00
Frederik Bolding
f03f2d3f79
[FLASK] snaps@0.34.0-flask.1 (#19377)
* snaps@0.34.0-flask.1

* Update LavaMoat policies

* Replace instances of targetKey with targetName

* Replace use of PermissionKeys with PermissionNames

* Use Flask packages in tests for now

* Bump execution env

* Add another mock

* Fix lint
2023-06-05 13:51:19 +02:00
Albert Olivé
9195057136
[MMI] Added code fencing in libs folder (#17929) 2023-06-02 18:40:58 +02:00
Bernardo Garces Chapero
67555fc879
accept approval request first (#19409) 2023-06-02 11:07:08 +01:00
Mark Stacey
20f028bf6f
Update @metamask/approval-controller to v3 (#19365)
The `@metamask/approval-controller` package has been updated to v3.
This version was part of the [core monorepo v53](MetaMask/core#1385)
release. The remaining packages released as part of v53 will be updated
in later PRs.

The only breaking change in this release was to update the minimum
supported Node.js version to v16.

Note that this will temporarily introduce peer dependency warnings
because of the major version bump. These are safe to avoid for now
because nothing is affected by the Node.js minimum version bump.

A resolution has been added to force v3 to be used throughout the
dependency tree so that this bump doesn't unnecessarily bloat our
dependencies. In practice this is only being used in one place, the
other references are just for types.

The resolution can be removed once the last package using this
controller has been updated, which will happen as part of #19271. The
peer dependency warnings will be resolved once #19271 is completed as
well.

Relates to #19271
2023-05-31 20:10:20 -02:30
Mark Stacey
81dbb27c73
Update @metamask/notification-controller to v3 (#19364)
The `@metamask/notification-controller` package has been updated to v3.
This version was part of the [core monorepo v53](MetaMask/core#1385)
release. The remaining packages released as part of v53 will be updated
in later PRs.

The only breaking change in this release was to update the minimum
supported Node.js version to v16.

Relates to #19271
2023-05-31 20:10:05 -02:30
Soralit
63b810f0db
fix: keystone sign request break (#19349) 2023-05-31 19:36:20 -02:30
Mark Stacey
58c0ac8b53
Update @metamask/address-book-controller to v3 (#19345)
The `@metamask/address-book-controller` package has been updated to v3.
This version was part of the [core monorepo v53](https://github.com/MetaMask/core/pull/1385)
release. The remaining packages released as part of v53 will be updated
in later PRs.

This release included a number of breaking changes relating to the
`chainId` format change from `string` to `Hex`. However these changes
don't affect the extension because it was already using `Hex` chain IDs
for all address book interactions.

Relates to #19271
2023-05-31 19:32:08 -02:30
Mark Stacey
000c1f2ef4
Update @metamask/controller-utils to v4 (#19344)
The package `@metamask/controller-utils` has been updated to v4. This
version was part of the core monorepo v53 release. The remaining
packages released as part of v53 will be updated in later PRs.

This release included a variety of breaking changes, but most of them
did not affect the extension's usage of this library. The one that did
have an impact was the removal of the `Json` type, which was identical
to the `Json` type in `@metamask/utils`. We're now using the
`@metamask/utils` version of this type exclusively.

Relates to #19271

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-05-31 18:33:29 -02:30
legobeat
bdf32199d1
devDeps: yargs@7.1.1->7.1.2 (#19057)
CVE-2020-7608 / GHSA-p9pc-299p-vxgp
2023-06-01 05:45:21 +09:00
legobeat
dc580c1cf1
devDeps: squirrelly@^8.0.8->^9.0.0 (#19113)
CVE-2021-32819 / GHSA-q8j6-pwqx-pm96
2023-06-01 05:21:42 +09:00
Mark Stacey
d09c8bd492
Update @metamask/announcement-controller to v4 (#19348)
The `@metamask/announcement-controller` has been updated to v4, which
is the version released in the core monorepo v53 release. The remaining
packages released as part of v53 will be updated in later PRs.

The only breaking change is that the minimum Node.js version was
updated to v16.

Relates to #19271
2023-05-31 13:19:34 -02:30
Mark Stacey
7f82ea231c
Update @metamask/base-controller to v3 (#19343)
The `@metamask/base-controller` has been updated to v3, which is the
version released in the core monorepo v53 release. The other packages
released as part of v53 will be updated in later PRs.

Relates to #19271
2023-05-31 12:38:07 -02:30
António Regadas
edf2cc41cb
[MMI] adds mmi code fences to mm controller (#18279)
* adds code fencing

* MMI adds mmi-controller

* MMI prettier

* chore: create keyring builder for CustodyKeyrings

* updates code fence to build-mmi

* adds dependencies

* fix import and prettier

* lint

* clean up

* clean up

* removes old methods and adds new

* comment for now

* adds two missing methods

* runs yarn dedupe

* adds missing import

* bump target values

* lavamoat policy update

* bump values in coverage targets

* prettier import order

* coverage report update

* clean up

* yarn update

* yarn dedupe

* ran lavamoat:auto

* adds zlib entry to storybook/main.js

* adds browserify-zlib

* clean up

* clean up

* prettier

* prettier

* eslint fix

* fix paths

* fix prettier

* fix file name for mocha

* adds to config

* rename

* adds file to configs

* test lavamoat clean up

* run dedupe

* sets value in storybook main.js as false

* runs lavamoat auto

* updates mmi packages to lighter versions

* updates mmi packages

* lavamoat auto

* adds finalized tx status

* lavamoat auto

* yarn dedupe

* clean up

* moving stuff into mmi controller

* clean up

* updates tresholds

* yarn lock review

* updates the mmi controller

---------

Co-authored-by: Shane Terence Odlum <shane.odlum@consensys.net>
2023-05-29 16:38:28 +01:00
Albert Olivé
057188d155
[MMI] Add code fences in signature-request (#18770)
* Started adding code fences in signature-request

* Finished code fencing

* Improving code

* Fixed storybook and code fences bundle

* Added missing dependency

* Fixed yarn.lock

* Fixing policies

* Updated package.json

* updating lavamoat

* lavamoat fix

* adds missing package

* runs yarn dedupe

* updates method name

* run lavamoat:auto again

* Added more code fences

* updates snapshot

* snapshot updates

* updates mmi packages to lighter versions

* updates mmi packages

* runs lavamoat auto

* updates yarn lock and runs lavamoat auto

* updates yarn lock

* updates targets file

* Removed console log and added tests

---------

Co-authored-by: António Regadas <apregadas@gmail.com>
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: Antonio Regadas <antonio.regadas@consensys.net>
2023-05-24 13:41:21 +02:00
Elliot Winkler
6267fa37c9
Bump dependencies of network-controller (#19172)
In preparation for introducing `@metamask/network-controller`, we want
to ensure that any packages that depend on this package are up to date
so that we are using the same version of `@metamask/network-controller`
in the dependency tree.

The extension uses two packages that depend on
`@metamask/network-controller`: `@metamask/assets-controllers` and
`@metamask/gas-fee-controller`. This commit upgrades them to the latest
version. There are no breaking changes in the new release of these
packages so there are no accompanying compatibility changes.
2023-05-19 09:34:29 -06:00
legobeat
8675c7863e
devDeps: storybook@7 (#19092)
* devDeps: pin @babel/core and @babel/runtime in resulotions
    Without this: misses patch, lavamoat error


* storybook 6 to 7 migration
* devDeps: add @storybook/addon-mdx-gfm
* fix lint deps
* devDeps: remove unused require-from-string
* devDeps/resolutions: @types/react@^16.9.53
* devDeps: add @storybook/cli
* storybook: new-frameworks migration
* iyarc: remove resolved dependency advisory
* deps: set globalthis@1.0.1 in resolutions
   This is required since a file is copied over from a set path in the dist
   package subdirectory as of d13aabde23 (#10014).
   A future update should either vendor the shim, or update to
   compatibility with a maintained upstream version.

* mdx2 migration fixes
* chore: bump ljharb packages
* devDeps: @storybook/*@^7.0.10->^7.0.11
* storybook: update preview.js to use v7 addon api
* ci/test/storybook: echo between storybook build&test
* ci/circleci: resources tweak
* info-tab: handle undefined global.platform
* update lavamoat build policy
* update lavamoat browserify policies
2023-05-18 11:07:42 +09:00
Daniel
471889e5bb
Enable token detection for the Aurora network, fix primary token for Aurora, update a URL (#19009) 2023-05-16 17:57:04 +02:00
Frederik Bolding
125021e425
[FLASK] snaps-monorepo@0.33.1-flask.1 (#18913)
* snaps-monorepo@0.33.0-flask.1

* Add browser-passworder

* Patch babel/core

* Fix PermissionController messenger allowlist

* Update test-snaps

* Use latest patch

* Update LavaMoat policies

* Re-enable RPC E2E

* Make snaps iframe URL be a env variable and bump it

* Add new env variable to test env

* Add iframe URL to desktop build
2023-05-15 19:36:24 +02:00
OGPoyraz
37a2be0fbb
Add getCurrentChainId argument to SignatureController (#19078) 2023-05-11 10:22:42 +02:00
George Marshall
32688c2e3c
Adding ModalFocus component (#18979) 2023-05-09 14:33:29 -07:00
Pedro Figueiredo
6e180af313
remove pre commit hook for branch names (#19077)
* remove pre commit hook for branch names

* bail with ticket number 0 detected
2023-05-09 20:39:38 +01:00
legobeat
37b481f305
devDeps: react-devtools@4.16.0->4.27.6 (#18869) 2023-05-09 00:11:36 +09:00
António Regadas
7ebd561ff9
[MMI] adds mmi logic in home view (#18960)
* adds mmi logic to home container

* adds code fences to home component

* adds code fences to home component

* lint fix

* lint fix

* updates fences and runs prettier

* version bump

* clean up code fence
2023-05-08 15:09:00 +01:00
legobeat
1c199d3223
devDeps: storybook-dark-mode@1.1.2->2.1.1 (#18866)
* devDeps: @storybook/*->6.5.16

* devDeps: storybook-dark-mode@1.1.2->2.1.1

* add lavamoat build policy override
2023-05-08 22:48:29 +09:00
Pedro Figueiredo
8df3bc9c1b
Label PRs based on the labels of the associated issue (#17603)
* Implement CI to copy issue labels over to PRs

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* clean up

* clean up
2023-05-08 09:51:02 +01:00
Brad Decker
b60b9f441f
Bundle size reduction: Upgrading ethereumjs/tx and ethereumjs/common (#18302)
* upgrade ethereumjs/tx and deps

* Yarn dedupe

---------

Co-authored-by: Dan J Miller <danjm.com@gmail.com>
2023-05-05 10:55:41 -05:00
Matthew Walsh
f62d8fce61
Use core signature controller (#18654) 2023-05-05 13:05:52 +01:00
legobeat
924df55e89
devDeps: pretty-error@2.1.1->2.1.2 (#18868)
CVE-2021-3803 / GHSA-rp65-9cf3-cjxr
2023-05-04 08:11:20 +09:00
Frederik Bolding
910b9e713f
Use separate versions for Flask and Stable snaps (#18875)
* Use separate versions for Flask and Stable snaps

* Update LM policy override

* Add deps to depcheck

* Improve import
2023-05-03 15:16:43 +02:00
Peter
2589d8d5d3
E2E: update selenium webdriver (#18854)
* update package

* yarn lock deduplication
2023-04-28 14:11:27 +01:00
legobeat
576eee7adf
devDeps: eslint@8.14.0,8.20.0->8.36.0 (#18748)
* devDeps: eslint@8.14.0,8.20.0->8.36.0

- CVE-2021-4279 / CVE-2021-4279
- consolidate eslint into single version
  - port patches

* add eslintignore directive

* lavamoat: update build policy overrides
2023-04-28 07:45:15 +09:00
Andrew Peters
bbb35dbe8d
update ses@0.18.4 (#17521)
* update ses import directory
* agoric references removed
* domainTaming set to unsafe

---------

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-27 21:31:52 +09:00
seaona
6e4de3bee8
[e2e] test-dapp update to v6.0.0 (#18844)
* Test dapp update to v6.0.0 and tweak initial token amounts to adjust to the new contract

* Update gas estimates for new TST contract

---------

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-27 13:01:17 +02:00
legobeat
2943ec3310
devDeps: bumps source-map related dependencies (#18830)
* devDeps: bumps source-map related dependencies

* update lavamoat build policy
2023-04-27 00:07:04 +09:00
legobeat
b4fc0bddd2
devDeps: bump @storybook/* (#18832)
* devDeps: @storybook/*->6.5.16
* devDeps: copy-webpack-plugin@6.0.3->6.4.1

CVE-2021-27290 / GHSA-vx3p-948g-6vhq
2023-04-27 00:06:38 +09:00
OGPoyraz
6d0f3a0b26
Consume Decrypt Message Manager from @metamask/message-manager (#18379) 2023-04-26 17:02:33 +02:00
legobeat
bc3baaed31
deps: bump json5, loader-utils, minimist (#18733)
* deps: json5@1.0.1->1.0.2; minimist@1.2.7->1.2.8

- CVE-2022-46175 / GHSA-9c47-m6qq-7p4h

* deps: loader-utils@1.4.0->1.4.2

- CVE-2022-37599 / GHSA-hhq3-ff78-jv3g
- CVE-2022-37603 / GHSA-3rfm-jhwj-7488
- CVE-2022-37601 / GHSA-76p3-8jx3-jpfq
2023-04-26 21:13:59 +09:00
legobeat
2c1ed4e8f0
deps: replace gulp-dart-sass with gulp-sass. (#16302)
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2023-04-25 09:37:30 -05:00
Olaf Tomalka
95c37e1ba3
feat: add yaml feature management (#18125)
* feat: add yaml feature management

Add yaml feature file per build type.
Also add method to parse yaml and set
enabled features env to true. The build
process will then replace any process.env[feature]
that exists on the config by its value

* chore: add example for desktop

* Added initial draft of build features

* [TMP] Sync between computers

* Is able to succesfully build stable extension with snaps feature

* Removing var context from builds.yml

* Add asssets to builds.yml

* Minor bug fixes and removing debug logs

* [WIP] Test changes

* Removed TODOs

* Fix regession bug

Also
* remove debug logs
* merge Variables.set and Variables.setMany with an overload

* Fix build, lint and a bunch of issues

* Update LavaMoat policies

* Re-add desktop build type

* Fix some tests

* Fix desktop build

* Define some env variables used by MV3

* Fix lint

* Fix remove-fenced-code tests

* Fix README typo

* Move new code

* Fix missing asset copy

* Move Jest env setup

* Fix path for test after rebase

* Fix code fences

* Fix fencing and LavaMoat policies

* Fix MMI code-fencing after rebase

* Fix MMI code fencing after merge

* Fix more MMI code fencing

---------

Co-authored-by: cryptotavares <joao.tavares@consensys.net>
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2023-04-25 16:32:51 +02:00
legobeat
64d4bfbbe9
Use SIWE origin validation logic from @metamask/controller-utils (#18518)
* feat: use SIWE origin domain validation from @metamask/controller-utils
* deps: @metamask/controller-utils@3.2.0->3.3.0
2023-04-25 17:25:58 +09:00
legobeat
a827c444fb
devDeps: security updates roundup (#18739)
* devDeps: resolutions: git-url-parse@^12=>13.1.0
  - CVE-2022-2900 / GHSA-j9fq-vwqv-2fm2

Depended on from now abandoned @storybook/storybook-deployer
  - https://github.com/storybook-eol/storybook-deployer/pull/131
  - https://github.com/IonicaBizau/git-url-parse/releases/tag/13.0.0
  - https://github.com/IonicaBizau/git-up/releases/tag/7.0.0

* devDeps: source-map-explorer@2.4.2->2.5.3
* devDeps: bump terser dependencies
   - CVE-2022-25858 / GHSA-4wf5-vphf-c2xc
* devDeps: shelljs@0.8.4->0.8.5
   - CVE-2022-0144 / GHSA-4rq4-32rv-6wp6
* devDeps: serve-handler@6.1.3->6.1.5, minimatch@3.0.4->3.1.2
  - CVE-2022-3517 / GHSA-f8q6-p94x-37v3
* devDeps: bump x-default-browser-id in resolutions
  - CVE-2021-33623 / CVE-2021-33623
  - https://npm-diff.app/x-default-browser@0.4.0...x-default-browser@0.5.2
* devDeps: pin glob-parent@^6.0.2 in resolutions
  - CVE-2020-28469 / GHSA-ww39-953v-wcq6
2023-04-25 17:09:22 +09:00
legobeat
ff8b41042e
deps: bump serve-handler@6.1.3->6.1.5; minimatch@3.0.4->3.1.2 (#18734)
- CVE-2022-3517 / GHSA-f8q6-p94x-37v3
2023-04-24 22:44:24 +09:00
Frederik Bolding
eaa004c147
Bump @metamask/slip44 to 3.0.0 (#18773) 2023-04-24 15:43:43 +02:00
Bernardo Garces Chapero
8632acbba3
Update tokens controller (#18459)
* update tokens controller
2023-04-21 09:05:27 +01:00
legobeat
8e6f4b8831
deps/security: vm2@3.9.16->3.9.17 (#18707)
- CVE-2023-30547 / GHSA-ch3r-j5x3-6q2m
2023-04-21 11:10:26 +09:00
Elliot Winkler
24eae1d3c6
Use fake provider for NetworkController unit tests (#18628)
* Use fake provider for NetworkController unit tests

In the unit tests for NetworkController, it's important to prevent
network requests from occurring. Currently we do that by using Nock.
However, the `core` version of NetworkController uses a fake provider
object. This is arguably a better approach for unit tests because it
prevents us from having to think about the behavior that a specific
middleware may have. For instance, the Infura middleware intercepts
`eth_chainId` to return a static result, and the block cache middleware
replaces the `latest` block tag with the latest block number, making an
extra call to `eth_blockNumber` in doing so. We have to account for
these kinds of behaviors when using Nock, but we do not need to do this
when using a fake provider.

This should make it easier to compare the difference between the unit
tests in this repo vs. in the `core` repo, which should ultimately help
us merge the two controllers together.

* Rename fake-provider-engine to fake-provider

* Rearrange imports

* Move fake-provider and fake-block-tracker into a directory and exclude it from coverage

* Make FakeBlockTracker inert, and fix JSDocs

* Remove generics from FakeProvider

* Call beforeCompleting (and beforeResolving) using async/await

* Fix signature of sendAsync; align other signatures within FakeProvider

* No need to check whether error is not a string

* Don't exclude the provider-api-tests directory from coverage

* Make sure to mock both net_version and eth_getBlockByNumber when testing network status

* Fix FakeProvider so that none of the methods have optional callbacks
2023-04-20 15:21:41 -02:30
Mark Stacey
3776f4ad4c
Remove mobile sync feature (#18692)
The mobile sync feature has been removed. It has been disabled for
years. When we enable sync again, it will be using a different
implementation. This has already been removed on the mobile side.
2023-04-20 14:29:30 -02:30
Matthew Walsh
fa32c5deb9
Disable rate limiting for signature approval requests (#18594) 2023-04-14 18:33:53 +01:00
Elliot Winkler
26db0aee46
Convert NetworkController net client tests to TS (#18490)
In order to be able to better compare differences between the version of
NetworkController in this repo and the version in the `core` repo before
we replace this version with the `core` version, this commit converts
the NetworkController network client tests to TypeScript.

The added types here are copied from the `core` repo. We plan on
making more improvements on the `core` side at some point to polish the
tests and types and reduce some of the duplication, but for now we're
just trying to keep things as similar as possible.
2023-04-14 10:21:29 -06:00
legobeat
5d2c4c143a
devdeps: mocha@7.2.0->9.2.2 (#18195)
* devdeps: mocha@7.2.0->9.2.2

Maintenance upgrade

- Closes subdependency flat advisory
  - CVE-2020-36632 / GHSA-2j2x-2gpw-d8fm
- upgrade eslint-plugin-mocha to match
  - previously used `eslint-plugin-mocha` depended on mocha@^8.2.0

* devdeps: patch-bump ansi-regex

closes GHSA-93q8-gq69-wqmw

* update lavamoat policies
2023-04-14 10:49:22 +09:00
legobeat
135d4eaaaa
deps/security: vm2@3.9.15->3.9.16 (#18555)
CVE-2023-29199  / GHSA-xj72-wvfv-8985
2023-04-13 12:09:41 -02:30
Bernardo Garces Chapero
6ed72d6934
Refactor eth_getEncryptionPublicKey handling (#18319)
* add EncryptionPublicKeyController

* update message-managers package
2023-04-13 09:24:59 +01:00
Elliot Winkler
6439551075
Convert NetworkController unit tests to TypeScript (#18476)
This helps us more easily compare the unit tests for NetworkController
in this repo and the NetworkController in the `core` repo.

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-12 13:53:34 -06:00
Mark Stacey
4c62bc445e
Update controllers to include core v42 release (#18464)
All controllers from the core monorepo have been updated to be equal to
or greater than the versions included in the v42 core release.

This release included a breaking change to all controllers because the
package `isomorphic-fetch` was removed. That package was used to ensure
that a `fetch` polyfill was present, so that the controllers could be
used in a non-browser context. This breaking change does not affect the
extension because we already install a `fetch` polyfill in our unit test
environment, and in a real build the real `fetch` API is present.

The gas fee controller had an additional breaking change: the EIP 1559
API endpoint is now a required argument. This does not affect the
extension because this argument was already being set.
2023-04-12 11:02:14 -02:30
Elliot Winkler
3577d3545f
Convert NetworkController to TS (#18358)
Converting this controller to TypeScript furthers the goal of getting
this whole codebase converted, of course, but it also helps in comparing
the differences between this version of the NetworkController and the
version in the `core` repo more easily, which will ultimately help us in
coalescing the two implementations.

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-11 10:07:24 -06:00
Mark Stacey
16bfa1f728
Update the gas fee controller from v1 to v3 (#18466)
The gas fee controller has been updated from v1 to v3. The breaking
changes for v2 and v3 related to the `@metamask/network-controller`
type that was referenced. They don't affect the extension's usage of
this package, so they are non-breaking for the extension.

Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
2023-04-11 13:11:26 -02:30
legobeat
11d61af598
deps/security: vm2@3.9.11->3.9.15 (#18512)
Fixes CVE-2023-29017 / GHSA-7jxr-cg7f-gpgv
2023-04-09 10:42:45 +09:00
Mark Stacey
92556867f7
Update the announcement controller to v2 (#18465)
The announcement controller has been updated to v2.0.1. The breaking
change in v2 was the migration to the BaseControllerV2 API. This
affected the constructor, as well as some methods/properties that we do
not use.
2023-04-06 17:21:13 -02:30
OGPoyraz
6e40a0eb7e
feat: use siwe detection from @metamask/controller-utils (#18409) 2023-04-04 17:25:57 +02:00
Mark Stacey
7059894399
Update @metamask/swappable-obj-proxy (#18422)
* Update `@metamask/swappable-obj-proxy`

The package `@metamask/swappable-obj-proxy` has been updated to the
latest version. The breaking changes include moving the package under
the `@metamask` scope and converting it to TypeScript.

* Update policy
2023-04-04 09:27:51 -02:30
Mark Stacey
be41b29199
Update @metamask/obs-store (#18421)
`@metamask/obs-store` has been updated from v5 to v8. The breaking
changes include updating the minimum supported Node.js version to v12,
and removing an unused class `LocalStorageStore`. v8 includes a bugfix
that resolves an accidental breaking change in v6.0.2; it's non-
breaking when updating from older versions.

This update includes type improvements. The main improvement is that
now we can type the observational store using generic parameters. The
previous version used `unknown` for the store contents.
2023-04-03 15:58:56 -02:30
Mark Stacey
74f2d27d10
Update @metamask/safe-event-emitter (#18419)
The package `safe-event-emitter` has been updated to v2. This update
includes renaming the package to be scoped under `@metamask`, and it
includes a TypeScript migration.
2023-04-03 15:57:39 -02:30
Danica Shen
26fed9e8da
fix(18194): Redirect to extension expanded view when click back to sa… (#18376)
* fix(18194): Redirect to extension expanded view when click back to safety button

* Bump phishing warning version

---------

Co-authored-by: Dan J Miller <danjm.com@gmail.com>
2023-03-31 10:00:44 +01:00
Frederik Bolding
a53b9fb489
[FLASK] snaps-monorepo@0.32.2 (#18371)
* snaps-monorepo@0.32.0

* Update LavaMoat policies

* Add JsonSnapRegistry

* Fix lint

* [FLASK] Handle side-effects changes in metamask-controller (#18373)

* Update PermissionController

* Fix lint

* Update iframe-execution-environment

* snaps-monorepo@0.32.1

* Bump test-snaps

* Update version assertion

* Update URLs

* Fix lint

* snaps-monorepo@0.32.2

---------

Co-authored-by: Guillaume Roux <guillaumeroux123@gmail.com>
2023-03-30 23:57:28 +02:00
Alex Donesky
349c9d4a03
Refactor network client constructor (#17652) 2023-03-22 17:20:59 -05:00
Pedro Figueiredo
34ba62470a
bump contract metadata package version (#18278)
* bump contract metadata package version

* bump contract metadata package version
2023-03-22 18:06:05 +00:00
legobeat
d3026e7338
devdeps: webpack@5.75.0->5.76.2 (#18182)
CVE-2023-28154 / GHSA-hc6q-2mpp-qw7j
2023-03-22 10:00:44 +09:00
legobeat
3fc2adac87
devdeps: resolve-url-loader@3.1.2->3.1.5 (#18183)
* devdeps: resolve-url-loader@3.1.2->3.1.5

- bump/dedupe subdependency loader-utils
  - closes GHSA-76p3-8hx3-jpfq / CVE-2022-37601
  - closes GHSA-3rfm-jhwj-7488 / CVE-2022-37603
  - closes GHSA-hhq3-ff78-jv3g / CVE-2022-37599
- bump/dedupe subdependency emojis-list

* devdeps: loader-utils@2.0.0->2.0.4

- closes GHSA-76p3-8hx3-jpfq / CVE-2022-37601
- closes GHSA-3rfm-jhwj-7488 / CVE-2022-37603
- closes GHSA-hhq3-ff78-jv3g / CVE-2022-37599
2023-03-22 09:59:59 +09:00
Matthew Walsh
bf29922488
Use core message managers and create sign controller (#18163) 2023-03-20 13:19:50 +00:00
legobeat
c21c2bdcf0
security: patch request for CVE-2023-28155 (#18208)
* security: patch request for CVE-2023-28155

GHSA-p8p7-x288-28g6

Ported from https://github.com/request/request/pull/3444

* add iyarc exclusion
2023-03-17 11:59:39 -02:30
Guillaume Roux
d6f58bceb0
[FLASK] snaps-monorepo@0.31.0 (#18142)
* allow SnapController to call `ApprovalController:updateRequestState` action

* combine popups

* show only autorship pill on result

* lint

* update `snaps-monorepo@0.31.0` and regen policies

* dedupe deps and fix fencing

* fix update button text

* fix fencing

* Update a bunch of e2es

* address requested changes

* update policy

* bump key-tree

* fix lint

* Update RPC E2E

* fix locales

* Remove wrong instance of window handle polling

* design changes and address pr comments

* remove unused imports

* fix lint

* fix fencing

* remove unused locales

* fence things

* re-add redirection

* bump test-snaps version

* Fix update e2e

* fix redirecting logic and address requested changes

* force update metamask state on approved

* move force update

---------

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
2023-03-17 12:00:05 +01:00
Frederik Bolding
872a8c79f4
Bump @metamask/utils to 5.0.0 (#18155)
* Update utils

* Ignore as-sha256

* Update LavaMoat policies
2023-03-16 11:33:40 +01:00
Peter
29674537e8
Update chromedriver v111 (#18120)
* update chromedriver to v111

* update chrome binary used in CI
2023-03-13 16:50:38 +00:00
witmicko
fde18dec0c
link component (#17897)
Added externlalLink to ButtonLink

Co-authored-by: George Marshall <george.marshall@consensys.net>
2023-03-10 17:47:01 +00:00
Hassan Malik
7086494b72
[FLASK] BREAKING - snaps-monorepo@0.30.0 (#17718)
* updated snap permission to wallet_snap, updated tests and added migration

* updated snap packages

* yarn.lock fix

* fixed errors

* override policy

* update policy

* undo override

* updated localization message descriptions

* updated lavamoat policy

* more policy updates

* update permission controller version

* update policy

* update fixture builder

* updated code to include permission value to satisfy wallet_snap permission description call

* fix import issue

* update test-snaps version

* added missing actions, added snap permission dedupe function

* prettier fix

* fix fencing

* add more fencing

* prettier fix

* fix fencing (again)

* added new action and selector and updated view snap accordingly

* update test snaps website version

* unfence request variable

* add fencing

* add optional chaining to fix type error

* update migration #

* remove old migration

* prettier fix

* fix migration test

* fix fencing

* added missing fencing

* updated code to workaround fencing

* update test-snaps site version and remove snap confirm test

* update snap packages

* update policies

* fix merge marker issue

* update test

* more fixes

* fix permissions

* update test

* fixed test

* Bump test-snaps and iframe-execution-environment

* remove unused snap permission from fixture builder

* update policies

* undo comment removal, update selector implementation

* removed unnecessary function, updated migration, updated caveat action

* remove optional chaining

* fix type issue

* more type fixes

* fix migration test

* remove isFlask check, make migration logic more robust

* update coverage

* Update LavaMoat policies

* Update test/e2e/snaps/enums.js

* add extra bail condition

* Revert "add extra bail condition"

This reverts commit b45c53dcfc6e6e35a5e283d4955d6d6ea9ca5965.

* Revert "Revert "add extra bail condition""

This reverts commit cd2ded677935c9cdab0c02b6af55474c83727f60.

* fix test

* add SnapController entry to state object

* updated permission name and caveat type with hardcoded values

* add extra test for non-flask scenario

* update lavamoat policies

* fix locale messages

* change coverage target

* re-enable rpc snap test

* revert locale message change

* fix el message

* reverted changes

---------

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
2023-03-08 13:29:23 -05:00
George Marshall
848b699f68
Adding types file to Box component (#18009) 2023-03-08 09:35:16 -08:00
Pedro Figueiredo
6222cf0b7d
increment keyring controller version (#18036) 2023-03-08 16:55:59 +00:00
weizman
601e02c5ee
Bump Snow 1.5.0 (#17985) 2023-03-08 13:09:16 +02:00
chloeYue
7f648e4acf
bump testdapp to v5.6.0 (#17967) 2023-03-02 20:28:18 +01:00