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

1945 Commits

Author SHA1 Message Date
MetaMask Bot
31d5c1cf22
Version v10.18.4 RC (#15643)
* Version v10.18.4

* Fix default currency symbol for `wallet_addEthereumChain` + improve warnings for data that doesn't match our validation expectations (#15201)

* set more appropriate default for ticker symbol when wallet_addEthereumChain is called

* throw error to dapp when site suggests network with same chainId but different ticker symbol from already added network, instead of showing error and disabled notification to user

* Fix Provider Tracking Metrics (#15082)

* fix filetype audit (#15334)

* Remove decentralized 4byte function signature registry since it contains incorrect signatures and we can't algorithmically check for best option when 4byte.directory is down (#15300)

* remove decentralized 4byte function signature registry since it is griefed and we can't algorithmically check for best option when 4byte is down

* add migration

* remove nock of on chain registry call in getMethodDataAsync test

* remove audit exclusion (#15346)

* Updates `eth-lattice-keyring` to v0.10.0 (#15261)

This is mainly associated with an update in GridPlus SDK and enables
better strategies for fetching calldata decoder data.
`eth-lattice-keyring` changes:
GridPlus/eth-lattice-keyring@v0.7.3...v0.10.0
`gridplus-sdk` changes (which includes a codebase rewrite):
GridPlus/gridplus-sdk@v1.2.3...v2.2.2

* Fix 'block link explorer on custom networks' (#13870)

* Created a logic for the 'Add a block explorer URL'

Removed unused message

Message logic rollback

Modified history push operation

WIP: Pushing before rebasing

Applied requested changes

Removed unintenionally added code

* Lint fix

* Metrics fixed

* Stop injecting provider on docs.google.com (#15459)

* Fix setting of gasPrice when on non-eip 1559 networks (#15628)

* Fix setting of gasPrice when on non-eip 1559 networks

* Fix unit tests

* Fix logic

* Update ui/ducks/send/send.test.js

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

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

* [GridPlus] Bumps `eth-lattice-keyring` to v0.11.0 (#15490)

* [GridPlus] Bumps `gridplus-sdk` to v2.2.4 (#15561)

* remove exclusions for mismatched object jsdoc type casing (#15351)

* Improve `tokenId` parsing and clean up `useAssetDetails` hook (#15304)

* Fix state creation in setupSentryGetStateGlobal (#15635)

* filter breadcrumbs for improved clarity while debugging sentry errors (#15639)

* Update v10.18.4 changelog (#15645)

* Auto generated changelog

* Update 10.18.4 changelog

* Run lavamoat:auto

* Call metrics event for wallet type selection at the right time (#15591)

* Fix Sentry in LavaMoat contexts (#15672)

Our Sentry setup relies upon application state, but it wasn't able to
access it in LavaMoat builds because it's running in a separate
Compartment.

A patch has been introduced to the LavaMoat runtime to allow the root
Compartment to mutate the `rootGlobals` object, which is accessible
from outside the compartment as well. This lets us expose application
state to our Sentry integration.

* Fix Sentry deduplication of events that were never sent (#15677)

The Sentry `Dedupe` integration has been filtering out our events, even
when they were never sent due to our `beforeSend` handler. It was
wrongly identifying them as duplicates because it has no knowledge of
`beforeSend` or whether they were actually sent or not.

To resolve this, the filtering we were doing in `beforeSend` has been
moved to a Sentry integration. This integration is installed ahead of
the `Dedupe` integration, so `Dedupe` should never find out about any
events that we filter out, and thus will never consider them as sent
when they were not.

* Replace `lavamoat-runtime.js` patch (#15682)

A patch made in #15672 was found to be unnecessary. Instead of setting
a `rootGlobals` object upon construction of the root compartment, we
are now creating a `sentryHooks` object in the initial top-level
compartment. I hadn't realized at the time that the root compartment
would inherit all properties of the initial compartment `globalThis`.

This accomplishes the same goals as #15672 except without needing a
patch.

* Update v10.18.4 changelog

* Fix lint issues

* Update yarn.lock

* Update `depcheck` to latest version (#15690)

`depcheck` has been updated to the latest version. This version pins
`@babel/parser` to v7.16.4 because of unresolved bugs in v7.16.5 that
result in `depcheck` failing to parse TypeScript files correctly.

We had a Yarn resolution in place to ensure `@babel/parser@7.16.4` was
being used already. That resolution is no longer needed so it has been
removed. This should resove the issue the dev team has been seeing
lately where `yarn` and `yarn-deduplicate` disagree about the state the
lockfile should be in.

* Update yarn.lock

* Update LavaMoat policy

* deduplicate

* Update LavaMoat build policy

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
Co-authored-by: Alex Donesky <adonesky@gmail.com>
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: Alex Miller <asmiller1989@gmail.com>
Co-authored-by: Filip Sekulic <filip.sekulic@consensys.net>
Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
Co-authored-by: Dan J Miller <danjm.com@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: seaona <54408225+seaona@users.noreply.github.com>
Co-authored-by: seaona <mariona@gmx.es>
Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
2022-08-24 19:57:47 +01:00
Dan J Miller
99f753d73f Metrics adjustments (#15313)
* Don't send errors to sentry if users have not opted-in to participate in metametrics

* Don't capture opt-out metrics

* Move the metrics-opt in screen to immediately after the welcome screen

* Ensure that global.getSentryState is set in the background

* Fix e2e tests after rearranging onboardin flow

* Fix unit tests

* More e2e test fixes

* Remove unnecessary wrappers around capture exception
2022-07-22 18:19:36 -02:30
PeterYinusa
810c00c108 mock contract interaction signature in e2e tests (#15297) 2022-07-21 08:24:54 +02:00
Dan J Miller
c63714c4f2 Show users a warning when they are sending directly to a token contract (#13588)
* Fix warning dialog when sending tokens to a known token contract address

Fixing after rebase

Covering missed cases

Rebased and ran yarn setup

Rebased

Fix checkContractAddress condition

Lint fix

Applied requested changes

Fix unit tests

Applying requested changes

Applied requested changes

Refactor and update

Lint fix

Use V2 of ActionableMessage component

Adding Learn More Link

Updating warning copy

Addressing review feedback

Fix up copy changes

Simplify validation of pasted addresses

Improve detection of whether this is a token contract

Refactor to leave updateRecipient unchanged, and to prevent the double calling of update recipient

Update tests

fix

* Fix unit tests

* Fix e2e tests

* Ensure next button is disabled while recipient type is loading

* Add optional chaining and a fallback to getRecipientWarningAcknowledgement

* Fix lint

* Don't reset recipient warning on asset change, because we should show recipient warnings regardless of asset

* Update unit tests

* Update unit tests

Co-authored-by: Filip Sekulic <filip.sekulic@consensys.net>
2022-07-13 19:46:30 -02:30
Dan J Miller
5e12aae541 Improve confirm screen tests (#15163)
* Improve confirm screen tests

* Fix transaction controller unit test

* Fix unit test fixtures

* Fix e2e test
2022-07-12 14:53:36 -02:30
Bowen Sanders
b486524c07
Snaps E2E Test Upgrades for the new test-snaps UI (#14980)
* fixed e2e tests for new UI

* fixed scrolling in tests to be bi-compatible

* updated enums to point to new UI version
2022-07-06 15:22:21 -07:00
PeterYinusa
4e1dbc6194
State logs e2e (#15123)
* download dir

* state logs e2e

* update ff version
2022-07-01 20:46:12 +01:00
PeterYinusa
dc780eeeb1
Send to hex-prefixed address e2e tests (#15111)
* add e2e test

* update variable name

* add test for ERC20
2022-07-01 17:40:31 +01:00
Brad Decker
94967072f7
Remove global transaction state from send flow (#14777)
* remove global transaction state from send slice

* fixup new test
2022-07-01 08:58:35 -05:00
Frederik Bolding
82645ba516
[FLASK] snaps-skunkworks@0.16.0 (#14952)
* snaps-skunkworks@0.16.0

* Bump iframe-execution-environment

* Add getAppKey

* Regen LavaMoat policy

* Bump test-snaps
2022-06-20 10:13:12 +02:00
Frederik Bolding
25aa3ab4b4
Update E2E tests for new test-dapp version (#14939)
* Update xDAI E2E information

* Use local Ganache instance instead of Gnosis Chain

* Bump test-dapp

* Bump test-dapp

* Enable secondary Ganache server for other test

* Fix linting

* Improve E2E stability

* Update network selector
2022-06-15 15:50:37 +02:00
Bowen Sanders
e546e137de
Create e2e test for snap in-app notification (#14894)
* Create e2e test for snaps in-app notification

* replaced xpath selectors

* fixed description
2022-06-08 12:07:41 -07:00
George Marshall
d6dc1b0c57
Updating some more instances (#14851) 2022-06-03 11:42:48 -07:00
Mark Stacey
43bd885be7
Merge pull request #14840 from MetaMask/master-sync
Sync `master` with `develop`
2022-06-03 14:34:06 -02:30
George Marshall
87bba78d1f
Updating all instances of Metamask to MetaMask in content, comments and tests (#14848) 2022-06-03 09:32:50 -07:00
Mark Stacey
13a1e63184 Update e2e test to reflect change in Chrome
Previously Chrome would ignore an attempt to navigate to a restricted
URL like an extension page that is not web accessible. In a recent
Chrome update, this has changed. Now it does perform the navigation,
but to an error page that explains that the request was invalid.

The last assertion, responsible for checking that the warning page is
still shown, has been removed. The test still ensures the main wallet
UI is not loaded, that assertion was not needed.
2022-06-03 11:53:45 -02:30
Mark Stacey
e6d5af5f9a Merge remote-tracking branch 'origin/develop' into master-sync
* origin/develop: (131 commits)
  Update `protobufjs` and remove obsolete advisory exclusion (#14841)
  Include snap version in pill (#14803)
  Update PULL_REQUEST_TEMPLATE.md (#14790)
  fix: keystone transaction qrcode has no white spacing (#14798)
  Snap notifications integration (#14605)
  Upgrade @metamask/eth-ledger-bridge-keyring (#14799)
  snaps-skunkworks@0.15.0 (#14772)
  Fix proptype errors in network dropdown, tx list item details, and account details modal tests (#14747)
  Ensure transaction type is correctly updated on edit (#14721)
  Add fiat onboarding for AVAX and MATIC through Wyre (#14683)
  Bump @metamask/contract-metadata from 1.33.0 to 1.35.0 (#14791)
  Slight cleanup of constants/transactions, useTransactionDisplayData, and TransactionIcon (#14784)
  Migrate the "estimateGas" API call to "getFees" for STX (#14767)
  Ignore advisory GHSA-wm7h-9275-46v2 (#14789)
  Adding flag for MV3 (#14762)
  Add types to send state (#14740)
  Remove site origin on snap install (#14752)
  Update design tokens library from 1.5 to 1.6 WIP (#14732)
  Enables the "Safe Transaction From" copy for safeTransferFrom transactions (#14769)
  remove draft transaction (#14701)
  ...
2022-06-03 11:53:40 -02:30
Mark Stacey
cf5db650fe Merge remote-tracking branch 'origin/master' into Version-v10.14.7
* origin/master: (101 commits)
  Updating changelog
  Add token standard to custom token details (#14506)
  Revert "Dark Mode: What's New Announcement (#14346)"
  Ensure network name in confirm page container is defined (#14520)
  Updating lavamoat policies
  Fix the alerts toggles in settings (#14498)
  Disable swaps whenever the environment is not development or testing, so that behaviour follows production for QA purposes (#14499)
  [skip e2e] Updating changelog for v10.14.0 (#14487)
  Version v10.14.0
  Docs - segment metrics (#14435)
  Add snaps view search (#14419)
  Run main, flask and beta in sequence in generate-lavamoat-policies.sh (#14470)
  Modify import SRP page (#14425)
  Dark Mode: Implement Metrics (#14455)
  HoldToRevealButton component (#13785)
  e2e test import json file as import account strategy (#14449)
  MetaMetrics: Identify 'number_of_tokens' user trait (#14427)
  MetaMetrics: Identify 'nft_autodetection_enabled' &  'opensea_api_enabled' (#14367)
  Swaps: Sort "token_from" dropdown tokens by their fiat value first and "token_to" by top tokens (#14436)
  Update segment instantiation check. Only check if SEGMENT_WRITE_KEY exists (#14407)
  ...
2022-06-02 18:30:23 -02:30
Guillaume Roux
b599035a12
Snap notifications integration (#14605)
* begin controller implentation

* add NotificationController

* create selectors and actions

* update actions tu use forceUpdateMetamaskState

* Basic notification UI

* fix typo and remove console.log

* lint

* more css

* add notifications scroll

* add translations and fix some css

* Fix rebase and edit colors

* add flask tags

* add flask tag to routes component

* add missing flask tags

* add tests

* fix tests

* store notification expiration delay in constant

* address requested changes

* rename to unreadNotificationsCount

* add missing flask tag
2022-06-01 19:09:13 +02:00
Daniel
6dbb2c4ded
Migrate the "estimateGas" API call to "getFees" for STX (#14767) 2022-05-26 19:56:28 +02:00
Frederik Bolding
66c049bb35
snaps-skunkworks@0.14.0 (#14700)
* snaps-skunkworks@0.13.0

* snaps-skunkworks@0.14.0

* Fix test

* Add long-running permission copy and icon

* Run linting

* Fix typo

* Bump E2E version
2022-05-18 13:49:26 +02:00
Erik Marks
ca6835a86d
Use enum for test snaps website URL (#14727)
* Use enum for test snaps website

* Fix confirm snap test
2022-05-17 10:39:55 +02:00
Mark Stacey
5a5e541b5e Fix e2e tests
The e2e tests have been updated for `@metamask/phishing-warning@1.1.0`.
The iframe case was updated with a new design, which required test
changes. The third test that was meant to ensure the phishing page
can't redirect to an extension page has been updated to navigate
directly to the phishing warning page and setting the URL manually via
query parameters, as that was the only way to test that redirect.
2022-05-16 18:48:20 -02:30
dragana8
d01a2ad7e5
Overall CSS #13441 (#13902)
* styling updates

Co-authored-by: Alex Donesky <adonesky@gmail.com>
Co-authored-by: George Marshall <george.marshall@consensys.net>
Co-authored-by: David Walsh <davidwalsh83@gmail.com>
2022-05-16 13:38:04 -05:00
Mark Stacey
7199d9c567 Use externally hosted phishing warning page
An externally hosted phishing warning page is now used rather than the
built-in phishing warning page.The phishing page warning URL is set via
configuration file or environment variable. The default URL is either
the expected production URL or `http://localhost:9999/` for e2e testing
environments.

The new external phishing page includes a design change when it is
loaded within an iframe. In that case it now shows a condensed message,
and prompts the user to open the full warning page in a new tab to see
more details or bypass the warning. This is to prevent a clickjacking
attack from safelisting a site without user consent.

The new external phishing page also includes a simple caching service
worker to ensure it continues to work offline (or if our hosting goes
offline), as long as the user has successfully loaded the page at least
once. We also load the page temporarily during the extension startup
process to trigger the service worker installation.

The old phishing page and all related lines have been removed. The
property `web_accessible_resources` has also been removed from the
manifest. The only entry apart from the phishing page was `inpage.js`,
and we don't need that to be web accessible anymore because we inject
the script inline into each page rather than loading the file directly.

New e2e tests have been added to cover more phishing warning page
functionality, including the "safelist" action and the "iframe" case.
2022-05-16 14:40:50 -02:30
Bowen Sanders
77c1100858
create e2e test for manageState snap (#14699) 2022-05-12 10:56:55 -07:00
Alex Donesky
5e55cf2cf2
add case in useTransactionDisplayData to handle transaction type safeTransferFrom (#14678)
* add case in useTransactionDisplayData to handle transaction type safeTransferFrom

* add test
2022-05-12 10:02:08 -05:00
PeterYinusa
890e0ed70f
Fix auto-lock e2e test (#14685)
Fixes auto lock e2e tests introduced in https://github.com/MetaMask/metamask-extension/pull/14624
2022-05-10 18:42:02 -07:00
PeterYinusa
f47d02b72a
Auto lock e2e (#14624)
* add auto lock e2e test

* fix console errors
2022-05-10 17:57:11 +01:00
Frederik Bolding
fa9d703aa0
Fix SRP paste duplication (#14625)
* Fix SRP paste duplication

* Remove else-case for paste event

* Add E2E test that would catch this issue in the future

* Fix linting
2022-05-09 14:46:20 +02:00
PeterYinusa
b0ad0cb1f3
E2e send tests (#14568)
* update fill method

* remove redundant steps

* remove arbitrary delays
2022-05-05 18:51:57 +01:00
Frederik Bolding
3b3a680682
Stop using 4bytes for contract deployment (#14598) 2022-05-02 16:49:01 -05:00
Guillaume Roux
6309d53650
Dark Mode : Add OS option in theme selection dropdown (#14379) 2022-04-28 14:36:28 +02:00
Bowen Sanders
c1e53b3330
Create new e2e test for bip-44 snap in test-snaps (#14440)
* created new test for bip-44 snap test

* added driver.Key.SPACE to allow sending spacebar

* made changes to final result check

* fixed expected pk result to proper value

* fixed to use npm package instead of local

* removed comment

* removed const delay - not needed (lint error)
2022-04-27 11:21:40 -07:00
ryanml
9cea6f57ef Revert "Dark Mode: What's New Announcement (#14346)"
This reverts commit af963d7f7b.
2022-04-26 09:24:22 -07:00
Alex Donesky
cf2c6a3164
show token approval details on confirm approve screen by default (#14523) 2022-04-26 10:21:52 -05:00
Thomas Huang
34d43e66ca
Update tx data for simpleSends and add isBestQuote to swaps data (#14496) 2022-04-22 00:04:37 -07:00
PeterYinusa
f947e5721a
E2e test timeout (#14483)
* e2e test timeout threshold

* enable logging for single test

* more logging

* remove redundant step in test
2022-04-21 16:51:03 +01:00
PeterYinusa
dd0b34c050
E2e connected state (#14444)
* Update contract-interactions.spec.js

* Update failing-contract.spec.js

* Update send-eth.spec.js

* Update navigate-transactions.spec.js
2022-04-20 09:37:34 +01:00
Alex Donesky
40095cce67
e2e test import json file as import account strategy (#14449) 2022-04-15 11:35:25 -05:00
PeterYinusa
99461941f8
enable skipped test (#14378) 2022-04-14 13:33:33 +01:00
seaona
dc3f14ffbb
E2e settings search msgs (#14386)
* Improve error messages with template literals

* Lint fix

* Changed variable let for const and scope
2022-04-13 17:26:26 +02:00
Dan J Miller
432c88e185 Remove duplicate gas simulation error messages (#14409)
* Remove duplicate gas simulation error messages

* Fixing locales

* Fixing unit tests

* Fixing e2e

Co-authored-by: ryanml <ryanlanese@gmail.com>
2022-04-13 08:01:21 -07:00
Dan J Miller
e768119dd0
Remove duplicate gas simulation error messages (#14409)
* Remove duplicate gas simulation error messages

* Fixing locales

* Fixing unit tests

* Fixing e2e

Co-authored-by: ryanml <ryanlanese@gmail.com>
2022-04-13 08:00:10 -07:00
seaona
8eb8fc1591
Remove unused function (#14423)
* Remove unused function

* Removed fetch mocks file as it's no longer used
2022-04-12 18:33:16 +02:00
gholmes86
d642dbc111
e2e test for swaps (#14393)
* chore: adding swap automation test

* chore:updating test for error
2022-04-12 11:57:18 +02:00
seaona
6db1be738d
E2e infura requests (#14394)
* Redirect infura requests to localhost while e2e

* Change requests from Infura to localhost (ganache)

* Included blacklisted hosts

* Fix behaviour for all urls

* Added a couple of explorers and reorg

* Remove repeated line

* Lint fix

* Removed other services aside from infura

* Includes changed for 'ends with'

* Fix security handling of host by including listed of arrays
2022-04-08 16:54:43 +02:00
seaona
b84e70895b
Feature Flag Swap API mock (#14353)
* Feature Flag Swap API mock

* Reorganize API calls in alphabetical order
2022-04-06 10:05:45 +02:00
David Walsh
af963d7f7b
Dark Mode: What's New Announcement (#14346) 2022-04-05 14:55:00 -05:00
seaona
78828f1b6e
Add e2e testcase for Settings Search functionality (#14259)
* Settings Search e2e testcase

* Remove unnecessary variable

* Include assertations for correct item urls

* Remove extra assertions

* Change assertion of url for page main header

* Remove un-used keys for urls

* Fix variable scope
2022-04-04 18:27:36 +02:00