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

2074 Commits

Author SHA1 Message Date
Mark Stacey
ec7e7fdf6d
Fix fallback gas estimation (#19746)
* Fix fallback gas estimation

Our fallback gas estimation was failing due to a bug in the
`@metamask/controller-utils` package. This was causing gas estimation
to fail completely on certain networks (those not supported by our gas
estimation APIs and non EIP-1559 compatibile), and it was causing the
fallback gas estimation operation (in case our API was down) to fail
across all networks.

Fixes https://github.com/MetaMask/metamask-extension/issues/19735

* Add e2e tests

E2E tests have been added to capture gas estimation. Cases are added
for our API, for the fallback estimate, and for non-EIP-1559 estimates.

As part of this work, the legacy gas API had to be disabled. This was
being used in e2e tests but was dead code in production. It needed to
be disabled to ensure the code under test was reachable.

* Fix gas API referenced in e2e test

* Update unit test snapshots
2023-06-26 16:13:16 -02:30
jiexi
0c047acdbf
Bump @metamask/providers to v11.1.0 (#19762)
* Bump @metamask/providers to v11.1.0

---------

Co-authored-by: Alex <adonesky@gmail.com>
2023-06-26 13:27:03 -05:00
Frederik Bolding
3df690b852
Use snaps@0.35.2-flask.1 and snaps@1.0.0-prerelease.1 (#19734)
* snaps@0.35.0-flask.1

* Update LavaMoat policies

* Update stable snaps packages to 1.0.0-prerelease.1

* Update LavaMoat policies

* Fix lint

* snaps@0.35.2

* Exclude snap_manageAccounts

* Code fencing

* Revert removing endowment:keyring exclusion

* Bump iframe URLs
2023-06-26 19:41:59 +02:00
Mark Stacey
55a8ff249c
Remove unused GitHub Action workflow (#19660)
This GitHub action workflow was disabled, but was still running setup
steps. It has now been removed entirely. We can re-introduce it again
later once the problem that led to it being disabled has been fixed.

The associated npm script and JavaScript module have been removed as
well.
2023-06-26 11:50:00 -02:30
Alex Donesky
e7e55dd873
Add tokenId type validation in wallet_watchAsset middleware (#19738) 2023-06-26 09:12:13 -05:00
weizman
365c1e32d2
Integrate Snow with LavaMoat scuttling protection (#17969) 2023-06-23 18:25:24 +03:00
Howard Braham
ed06926ac5
chore(tools): update geckodriver to 4.0.4 (#19558) 2023-06-22 21:00:40 -07:00
Mark Stacey
492038a312
Validate LavaMoat config in parallel (#19589)
The LavaMoat policies and allow-scripts configuration are now validated
in parallel. They are still only validated for release candidate
branches and the `master` branch.
2023-06-22 18:40:32 -02:30
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
Mark Stacey
3a61f179a3
Correctly categorize dev dependencies (#19676)
The two GitHub action dependencies were mistakenly listed as production
dependencies. They've been moved to `devDependencies` instead.

The `husky` development dependency was mistakenly listed as a
production dependency as well. It has been removed from that set, now
listed as just a `devDependency`.
2023-06-20 11:43:12 -02:30
OGPoyraz
39089e0f4c
Accept SignController approval request from frontend (#19184) 2023-06-20 15:37:09 +02:00
Gauthier Petetin
3bbfe87e9e
feat(action): github action to automatically add label "release-x.y.z" when PRs get merged (#19061)
* feat(action): github action to add release label when PR gets merged

* feat(action): make sure the action only runs for PRs merged in main branch

* fix(action): update labels default color

* fix(action): add check on release label format

* fix(action): type function explicitely

* feat(action): add possibility to extract next release version number from artifact

* fix(action): rename next rc cut number into next semver version

* feat(action): add a github action to create release branch

* fix(action): default branch is develop

* fix(action): specify name of workflow used to create release branch

* fix(action): handle case where artifact doesn't exist

* fix(action): create branch but not the PR

* feat(action): fetch next semver version from release branches name or from package.json

* fix(action): remove unused Create Release Branch action

* fix(action): release branch format was not correct

* feat(action): take tags into account when calculating next version number

* feat(action): add the possibility to force next semver version

* fix(action): update comments

* fix(action): adopt kebak-case instead of snake_case

* fix(action): rename PERSONAL_ACCESS_TOKEN into RELEASE_LABEL_TOKEN

* fix(action): yarn installation not required

* fix(action): yarn install shall be immutable

* fix(action): make the script compatible with ShellCheck

* fix(script): exit script earlier if condition is met

* fix(action): use closingIssuesReferences instead of timeline events

* fix(action): add execute permissions to script

* fix(action): remove duplicate comment
2023-06-20 09:29:35 -03:00
Dan Miller
953af884de Merge branch 'develop' into master-sync 2023-06-15 21:19:01 -02:30
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
António Regadas
1520f57b77
MMI start script and fixes a bug preventing it to run (#19594)
* adds MMI start script and fixes a bug preventing it to run

* lint fix
2023-06-15 17:57:35 +01: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
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
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
Bernardo Garces Chapero
b072a5c954 accept approval request first (#19409) 2023-06-13 07:07:24 -02:30
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
Dan J Miller
2258eaabef Merge branch 'master' into Version-v10.32.0 2023-06-09 10:52:45 -02:30
Elliot Winkler
84969c1b0e
Bump minimum Node version to 16.20.0 (#19520)
When using older versions of 16.x we may get this error when attempting
to build the extension:

    TypeError: Cannot assign to read only property 'Symbol(Symbol.iterator)' of object '[object Set]'
      at Object.buildAllowedFlags (node:internal/process/per_thread:375:53)
      at process.get [as allowedNodeEnvironmentFlags] (node:internal/bootstrap/node:279:34)
      at get (<anonymous>)
      at getOwn (node:internal/bootstrap/loaders:182:5)
      at NativeModule.syncExports (node:internal/bootstrap/loaders:294:31)
      at ModuleWrap.<anonymous> (node:internal/bootstrap/loaders:274:22)
      at NativeModule.getESMFacade (node:internal/bootstrap/loaders:279:17)
      at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:259:10)
      at loadNativeModule (node:internal/modules/cjs/helpers:49:9)
      at Function.Module._load (node:internal/modules/cjs/loader:804:15)

This error goes away when upgrading to a later version of 16.x.

To make sure this isn't an issue going forward, this commit bumps the
Node version requirement in `package.json`. 16.20.0 happens to be the
latest version of 16.x (to date).
2023-06-08 17:40:07 -06:00
Thomas Huang
f5b158dda6
Master sync follow v10.31.1 (#19517)
* Version v10.31.1

* fix: keystone sign request break (#19349)

* Update changelog for v10.31.1

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Soralit <soralitria@gmail.com>
Co-authored-by: Dan J Miller <danjm.com@gmail.com>
2023-06-08 09:17:41 -07: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
Soralit
14f1ac7a66 fix: keystone sign request break (#19349) 2023-06-01 12:22:54 -02:30
MetaMask Bot
a1050095d4 Version v10.31.1 2023-06-01 13:30:13 +00: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
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
MetaMask Bot
b667fde2e3 Version v10.32.0 2023-05-26 20:01:59 +00:00
Dan J Miller
e5a9dc8dcf Merge remote-tracking branch 'origin/develop' into master-sync 2023-05-26 15:08:25 -02:30
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
Dan J Miller
301c2e1beb Merge remote-tracking branch 'origin/master' into Version-v10.31.0 2023-05-19 13:33:39 -02:30
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