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

1960 Commits

Author SHA1 Message Date
Brad Decker
1db0ee87ec
Update Eslint and deps (#15293) 2022-07-26 13:10:51 -05:00
Dan J Miller
101fe0b27a
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:09:48 -02:30
Jyoti Puri
be47d78475
Fix for mv3 performance stats (#15321) 2022-07-22 16:24:14 +05:30
Jyoti Puri
45f5635cd8
Bundlesize stats over time (#15209)
* Adding tasks for MV3 test build

* more changes

* fix

* fix

* fix

* MV3 CI fixes

* fixes

* fix

* Initial work to capture the logs, write to file, and parse it.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* chrome debug logs

* Pull logs from webdriver and save to json file.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* comment out stats stuffs

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint Fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Remove console.log

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* fixes

* Adding build artifact for initialisation time

* change

* fix lint

* fix

* fix

* fix

* fix

* fixes

* Capturing load time stats

* fix

* fix

* fix

* fix

* fix build

* fix

* fix

* fix

* fix

* fix

* Initial work to capture the logs, write to file, and parse it.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* chrome debug logs

* Pull logs from webdriver and save to json file.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* comment out stats stuffs

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint Fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Remove console.log

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* fix

* fix

* fix

* fix

* Initial work to capture the logs, write to file, and parse it.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

chrome debug logs

Pull logs from webdriver and save to json file.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove console.log

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

split output of lavamoat to 2 files. background and ui

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* fix

* fix

* fix

* Enable logging to chrome_debug only if in MV3

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* fix

* fix

* fix

* fixes

* fix

* fix

* fix

* fix

* fixes

* test

* test

* fix

* fix

* MV3 bundle size stats

* fix

* Committing bundle size status to extension_bundlesize_stats repo

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* Initial commit

* Initial commit

* Initial commit

* Initial commit

* fixes

* fix

* fix

* fix

* fix

* fix

* fix

Co-authored-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
Co-authored-by: PeterYinusa <peter.yinusa@consensys.net>
2022-07-21 12:25:18 -10:00
Jyoti Puri
5bae544475
MV3 bundle size stats (#15191) 2022-07-21 23:10:24 +05:30
David Drazic
76c06692df
[e2e] Deploy contracts directly seeding Ganache (#14631)
* Add some experimental Ganache seeder WIP

Refactor GanacheSeeder

* Added all smart contract bytecodes and abis

* Deploy smart contract by contract name

* Clean up and fix tx hash

* Removed console logs

* Remove last console log

* Use node module path for grabbing contract constants

* Remove contract deployment example on e2e test

* Small refactor for removing extra line

Co-authored-by: seaona <mariona@gmx.es>
2022-07-21 19:08:01 +02:00
PeterYinusa
b60325cbcb
remove redundant code (#15306) 2022-07-21 14:46:50 +01:00
PeterYinusa
6233ed414d
mock contract interaction signature in e2e tests (#15297) 2022-07-20 18:39:40 +01:00
Jyoti Puri
45cecf385d
Adding artifacts (#15145) 2022-07-20 19:33:16 +04:00
Jyoti Puri
0622883a3c
Capturing load time stats (#15157) 2022-07-20 11:40:31 +04:00
Jyoti Puri
6aa0ecce2a
Capturing lavamoat stats in E2E (#15153) 2022-07-20 03:07:15 +04:00
PeterYinusa
12da4303be
Send to contract e2e (#15276)
* fix leave running flag

* reuse mock

* add send to contract waring test
2022-07-19 16:22:38 +01:00
PeterYinusa
0e0f2b4bb0
skip tests & fix build (#15280)
* skip tests

* lint
2022-07-18 15:46:12 -07:00
mirjanaKukic
6baa407f2c
add e2e test for token add approve action (#13797)
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2022-07-18 10:12:28 -05:00
Alex Donesky
09164dcabb
Bump controllers v30.0.2 (#14906)
* bump @metamask/controllers to v30.0.2 and adapt
2022-07-18 09:43:30 -05:00
PeterYinusa
9ae909d6a7
[E2E] Install Firefox extension from dist folder (#15255)
* update webdriver

* install extension from dist folder

* remove redundant code
2022-07-18 09:22:23 +01:00
PeterYinusa
5bf30606fe
[E2E] quit mocha after test (#15253)
* quit mocha after test

* lint
2022-07-18 09:19:49 +01:00
ryanml
9e63a9a449
Adding "What's New" Notification for Add Popular networks (#15121)
* Adding "What's New" Notification for Add Popular networks

* Adding action text to notification

* Addressing review feedback

* Flag removal
2022-07-14 11:08:32 -07:00
Dan J Miller
0c163dd8aa
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:45:38 -02:30
Dan J Miller
f785f77959
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:50:20 -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