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

17807 Commits

Author SHA1 Message Date
Frederik Bolding
f36261a9a6
Update snaps URLs (#20582) 2023-08-24 10:41:58 +02:00
Erik Marks
4a9316317f
Remove web3 shim usage event (#20376)
Removes the `Website Accessed window.web3 Shim` event from the `metamask_logWeb3ShimUsage` RPC method implementation. The method itself displays an alert to the user if a website attempts to access the `window.web3` shim, which we replaced the original, functional `window.web3` object with after said object was removed. This seems potentially useful, because we still get 5-star reviews on [the legacy web3 extension](https://addons.mozilla.org/en-US/firefox/addon/metamask-legacy-web3/).

The associated metrics event, on the other hand, is useless. It is rife with false positives, and doesn't tell us anything that we can't learn from download data for the legacy web3 extension. It's time to get rid of it.
2023-08-23 22:42:00 -07:00
David Walsh
79d9c18cb1
UX: Multichain: Add address to account picker, change connection to copy button (#20520)
* UX: Multichain: Add address to account picker, change connection to copy button

* Fix for very long account names
2023-08-23 11:36:03 -05:00
Daniel Rocha
0489911cc8
Remove call to _updateMemStoreKeyrings (#20369)
* Call the right `updateMemStoreKeyrings` method from `KeyringController`

* fix: don't call redundant methods

Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>

---------

Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>
2023-08-23 11:40:02 -04:00
Mark Stacey
391294d0d4
Merge pull request #20075 from MetaMask/Version-v10.35.0
Version v10.35.0 RC
2023-08-23 11:18:46 -02:30
Albert Olivé
b296f48c11
Fixing iconUrl issue setting the custodianName to custodianType if custodianName is undefined (#20565) 2023-08-23 15:40:11 +02:00
Frederik Bolding
3f24662a11
Update derivation paths used by snaps (#20558)
* Update derivation paths used by snaps

* Update testnets
2023-08-23 14:29:54 +02:00
Albert Olivé
021c293e46
Removed code fences that were causing to not being able to sign correctly (#20560) 2023-08-23 13:58:58 +02:00
Howard Braham
d3d30fd373
fix(settings): fixed two IPFS gateway issues (#19700)
* fix(settings): fixed two IPFS gateway issues

- adds back in two bugfixes that were originally in #19283
  - fixes #16871
  - fixes #18140

- achieves 100% code coverage for /ui/pages/settings/security-tab
- removes the npm package `valid-url`, which has not been updated in 10 years

* changes after #20172 was merged

* improved URL validation (specifically spaces)

* better Jest coverage

* response to legobeat review

* fixing lint and Jest
2023-08-22 22:13:13 -07:00
Dan J Miller
b8525566f2
Enable legacy HD paths for trezor users (#19552)
* Update eth-trezor-keyring to v1.1.0

* Revert "Revert "feature: Add legacy derivation path to Trezor (#19443)" (#19451)"

This reverts commit b5ef94b9f0.

* Fix trezor import

* Update lavamoat policies

* Remove accidentally committed code

* Fix type in previous commit
2023-08-22 16:11:52 -04:00
Albert Olivé
787fc13f19
Fixed bug that was causing to not show the correct account name and instead was displaying the default "Account x" one (#20555) 2023-08-22 17:50:33 +02:00
Pedro Figueiredo
e6cd452506
fix: Remove sentry warning on undefined TokenListController (#20547)
* fix sentry warning

* correct test

* switch to using spyOn method
2023-08-22 15:06:18 +01:00
MetaMask Bot
e543fca211
New Crowdin translations by Github Action (#18017)
Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
2023-08-22 14:34:31 +01:00
Gauthier Petetin
f1b00de693
fix(action): octokit not supported on MetaMask repos (#20544)
* fix(action): octokit not supported on MetaMask repos

The github action was constantly failing with the following error: octokit/request-action@v2.x is not allowed to be used in MetaMask/metamask-extension

* fix(action): shellcheck was failing

Shellcheck was failing in the CI. Had to craft the payload of the curl before doing the curl to fix this.
2023-08-22 07:49:36 -03:00
Matthew Walsh
37209a7d2e
Replace IncomingTransactionsController with helper (#20378)
Remove the IncomingTransactionController and replace it with an internal helper class.
Move incoming transactions into the central transactions object.
Create a new RemoteTransactionSource interface to decouple incoming transaction support from Etherscan.
Split the incoming transaction logic into multiple files for easier maintenance.
2023-08-22 10:17:07 +01:00
Mark Stacey
ace2138a94 Remove unnecessary change entry
The bug fix in #20536 wasn't necessary to include because the bug it
fixes was never in production. it was introduced in this release as
part of #17945.
2023-08-21 18:39:15 -02:30
Daniel
8ca0b762ad
Don't call "toPrecisionWithoutTrailingZeros" if a destination value is not a number (#20525) 2023-08-21 18:06:12 +02:00
Mark Stacey
702ee233e7
Remove snapshot update from release process (#20546)
The Sentry e2e state snapshots now mask the application version and
migration version, ensuring that the snapshots don't need a extra
update in each release candidate branch and post-release sync branch.

The values are masked rather than removed so that the test still shows
they are present in error reports, where they can be quite useful for
diagnostic purposes.
2023-08-21 12:53:04 -02:30
Mark Stacey
7f3ea4b906 Update changelog to include last two commits 2023-08-21 12:27:52 -02:30
Danyal Prout
88f294664f Specify that Base is a multilayer network (#20097) 2023-08-21 11:26:21 -02:30
Dan J Miller
838c8e1aa7 Use primary transaction to get token value in useTransactionDisplayData (#20536)
Co-authored-by: Jyoti Puri <jyotipuri@gmail.com>
2023-08-21 11:26:09 -02:30
Albert Olivé
a712298f18
updated mmi packages version (#20545)
* updated mmi packages version

* Update LavaMoat policies

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-08-21 15:49:54 +02:00
Mark Stacey
a56ab44c23
Merge pull request #20534 from MetaMask/master-sync
Master sync follow v10.34.5
2023-08-21 11:10:21 -02:30
Mark Stacey
8afa75e1f1 Update version in e2e state snapshot 2023-08-21 10:04:01 -02:30
Dan J Miller
12a1c66dc2
Use primary transaction to get token value in useTransactionDisplayData (#20536)
Co-authored-by: Jyoti Puri <jyotipuri@gmail.com>
2023-08-21 15:45:25 +05:30
Maarten Zuidhoorn
785e0d0923
[FLASK] Fix regression in transaction confirmation tabs (#20267)
* Fix regression in transaction confirmation tabs

* Fix transaction insights e2e test
2023-08-21 12:03:55 +02:00
Dan J Miller
a5bf7503f5 Lint changelog 2023-08-19 06:38:34 -02:30
Thomas Huang
03fa41c5be
Update changelog for v10.35.0 (#20139)
* [skip-e2e] Update changelog for v10.35.0

* [skip-e2e] Lint

* Remove MMI entries, and group flask entries

* Update CHANGELOG.md

---------

Co-authored-by: Dan J Miller <danjm.com@gmail.com>
2023-08-19 06:30:01 -02:30
Dan J Miller
9c712bc8e0 Update errors.spec.js e2e snapshot tests for v10.35.0 2023-08-19 03:56:15 -02:30
Dhruv
ba31f87014
fix/TagUrl to TS (#20519) 2023-08-18 17:59:02 -07:00
Dan J Miller
313deae6d1 Merge remote-tracking branch 'origin/master' into Version-v10.35.0 2023-08-18 21:13:57 -02:30
Dan J Miller
c32b406989 Merge origin/develop into master-sync 2023-08-18 21:09:08 -02:30
Dan J Miller
c6b83127bc
Merge pull request #20482 from MetaMask/Version-v10.34.5
Version v10.34.5
2023-08-18 20:39:14 -02:30
Michele Esposito
efd34343c8
Use KeyringController messenger events (#20341)
* refactor: use keyring-controller events and unlock methods

* test: add tests for setLocked

* rollback: call trezor dispose directly

* Update app/scripts/metamask-controller.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

---------

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2023-08-18 19:37:38 -02:30
Dhruv
07abc53cce
fix/BannerBase to TS (#20421)
* BannerBase to TS

* snapshot updates

* more snapshot updates

* addressing type definition error

* updating eth-sign-modal snapshot

* Updates to stories, types and adding data-testid

* Updating snapshots

* updating snapshot of blockaid-banner-alert and adding unit test for childrenWrapperProps

* BannerBase updates to stories, adding locale for close button, removing static data-testid in favor of using it at the instance, updating snapshots associated with those changes

* Removing incorrect arg from storybook file

* Updating html element in security provider e2e test to match BannerBase. Also updating snapshot of ConfirmTransaction page

* Fixing e2e tests

---------

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2023-08-18 14:52:40 -07:00
Mark Stacey
f83c7ff3ef
Update changelog for v10.34.5 (#20533) 2023-08-18 18:30:40 -02:30
Mark Stacey
ddeaeb5ba5 Fix Sentry breadcrumb collection during initialization (again) (#20532)
Sentry breadcrumb collection during initialization was broken in #20529
because we failed to consider that the `getSentryState` check was also
used for an opt-in check in the `beforeBreadcrumb` hook.

I had assumed that `getSentryState` was only used to get state to add
additional context to an error report. But the function has a second
purpose: to get state for the purposes of checking whether the user has
opted into MetaMetrics. In this second case, `mostRecentRetrievedState`
is sometimes unset (which violates an assumption made in #20529)

The `getMostRecentPersistedState` hook removed in #20529 has been
restored, ensuring that the `getSentryState` function returns Sentry
state after loading state for the first time, but before the first
error has occurred.

This mistake didn't cause e2e tests to fail because multiple errors are
currently thrown in the background upon initialization on `develop`
(relating to Snow scuttling). These errors were early enough that they
happened before the console logs that our breadcrumb test was testing
for. When #20529 was ported onto the v10.34.5 RC, these errors were not
present so the test failed correctly.
2023-08-18 18:26:50 -02:30
Mark Stacey
885a8ce256
Fix Sentry breadcrumb collection during initialization (again) (#20532)
Sentry breadcrumb collection during initialization was broken in #20529
because we failed to consider that the `getSentryState` check was also
used for an opt-in check in the `beforeBreadcrumb` hook.

I had assumed that `getSentryState` was only used to get state to add
additional context to an error report. But the function has a second
purpose: to get state for the purposes of checking whether the user has
opted into MetaMetrics. In this second case, `mostRecentRetrievedState`
is sometimes unset (which violates an assumption made in #20529)

The `getMostRecentPersistedState` hook removed in #20529 has been
restored, ensuring that the `getSentryState` function returns Sentry
state after loading state for the first time, but before the first
error has occurred.

This mistake didn't cause e2e tests to fail because multiple errors are
currently thrown in the background upon initialization on `develop`
(relating to Snow scuttling). These errors were early enough that they
happened before the console logs that our breadcrumb test was testing
for. When #20529 was ported onto the v10.34.5 RC, these errors were not
present so the test failed correctly.
2023-08-18 18:26:27 -02:30
George Marshall
dc6069a3ab
Deprecating ErrorMessage in favor of BannerAlert (#20461) 2023-08-18 13:27:10 -07:00
Mark Stacey
0a3241e30d Fix pre-initialization UI error state capture (#20529)
In the case where an error is thrown in the UI before initialization
has finished, we aren't capturing the application state correctly for
Sentry errors. We had a test case for this, but the test case was
broken due to a mistake in how the `network-store` was setup (it was
not matching the behavior of the real `local-tstore` module).

The pre-initialization state capture logic was updated to rely solely
upon the `localStore` instance used by Sentry to determine whether the
user had opted-in to metrics or not. This simplifies the logic a great
deal, removing the need for the `getMostRecentPersistedState` state
hook. It also ensures that state is captured corretly pre-
initialization in both the background and UI.
2023-08-18 16:35:03 -02:30
Mark Stacey
9cfa9ba6b0
Fix pre-initialization UI error state capture (#20529)
In the case where an error is thrown in the UI before initialization
has finished, we aren't capturing the application state correctly for
Sentry errors. We had a test case for this, but the test case was
broken due to a mistake in how the `network-store` was setup (it was
not matching the behavior of the real `local-tstore` module).

The pre-initialization state capture logic was updated to rely solely
upon the `localStore` instance used by Sentry to determine whether the
user had opted-in to metrics or not. This simplifies the logic a great
deal, removing the need for the `getMostRecentPersistedState` state
hook. It also ensures that state is captured corretly pre-
initialization in both the background and UI.
2023-08-18 16:32:28 -02:30
jainex
3d9457e517
Replacing deprecated Popover with Modal (#20413)
* Replacing deprecated Popover with Modal

* Replacing deprecated Popover with Modal in detected-token-ignored-popover

* Remove unused code

* fix hover problem

* update footerButton size to large

* Lint fix

* UI updates and removing unused CSS

* reset chnages in edit-gas-popover.component.js

---------

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2023-08-18 09:54:50 -07:00
Srirag
7f157cabf9
Deprecation message has been added above @mixin H1 (#20500) 2023-08-18 09:54:12 -07:00
Albert Olivé
8df77ed93d
[MMI] Always redirect to MMI portfolio dashboard upon the user clicking on swaps (#20527) 2023-08-18 18:44:23 +02:00
Gauthier Petetin
23249b68b7
feat: github actions to automatically create and close bug report issue (#20391)
* feat(action): github action to create bug report issue at RC cut

* feat(action): github action to close bug report issue once release is ready

* fix(action): replace main by master

* fix(action): create event does not support branch filter

* fix(action): indentation

* fix(action): actionlint erors

* fix(action): actionlint erors 2

* fix(action): actionlint erors 3

* fix(action): replace npm by yarn for consistency
2023-08-18 12:57:04 -03:00
Dan J Miller
016a1ef4e4 Remove GHSA-h755-8qp9-cq8 from advisory exclusions because yarn audit output no longer flags that advisory 2023-08-18 12:58:08 -02:30
Dan J Miller
fa778d5af9 Update snapshot tests for errors.spec.js 2023-08-18 12:55:33 -02:30
Dan J Miller
c2163434db Fix and test log.info calls run for each migration (#20517)
* Fix and test log.info calls run for each migration

In migrator/index.js, log.info is called before an after each migration.
These calls are intended to produce breadcrumbs to be captured by sentry
in cases where errors happen during or shortly after migrations are run.
These calls were not causing any output to the console because the log.setLevel
calls in ui/index.js were setting a 'warn value in local storage that was being
used by logLevel in the background.

This commit fixes the problem by setting the `persist` param of setLevel to
false, so that the background no longer reads the ui's log level.

Tests are added to verify that these logs are captured in sentry breadcrumbs
when there is a migration error due to an invariant state.

* Improve breadcrumb message matching

The test modified in this commit asserts eqaulity of  messages from breadcrumbs
and hard coded expected results. This could cause failures, as sometimes the
messages contain whitespace characters. This commit ensures the assertions only
check that the expected string is within the message string, ignoring extra
characters.
2023-08-18 11:16:42 -02:30
Mark Stacey
3e26da493f Initialize composable observable store after update (#20468)
* Initialize composable observable store after update

The composable observable store now updates state immediately when the
structure is updated. Previously each store would only be updated after
the first state change. This ensures that the composable observable
store state is always complete.

* SUpport falsy controller state

We now use the nullish coalescing operator when checkint store.state, so that we don't accidentally ignore falsy state.

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>

* Add test for falsy controller state

* Update state snapshots

A change on `develop` required another state update.

---------

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
2023-08-18 11:16:17 -02:30
Dan J Miller
ca1ddeb59b
Fix and test log.info calls run for each migration (#20517)
* Fix and test log.info calls run for each migration

In migrator/index.js, log.info is called before an after each migration.
These calls are intended to produce breadcrumbs to be captured by sentry
in cases where errors happen during or shortly after migrations are run.
These calls were not causing any output to the console because the log.setLevel
calls in ui/index.js were setting a 'warn value in local storage that was being
used by logLevel in the background.

This commit fixes the problem by setting the `persist` param of setLevel to
false, so that the background no longer reads the ui's log level.

Tests are added to verify that these logs are captured in sentry breadcrumbs
when there is a migration error due to an invariant state.

* Improve breadcrumb message matching

The test modified in this commit asserts eqaulity of  messages from breadcrumbs
and hard coded expected results. This could cause failures, as sometimes the
messages contain whitespace characters. This commit ensures the assertions only
check that the expected string is within the message string, ignoring extra
characters.
2023-08-18 11:15:45 -02:30