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

17404 Commits

Author SHA1 Message Date
Brad Decker
b86326b4bf
signature approved metrics e2e test (#19628) 2023-06-23 09:48:44 -05:00
Gauthier Petetin
ad3140c949
fix(action): add required permissions to remove labels (#19728) 2023-06-23 09:27:49 -03:00
Mark Stacey
3b9fd435fb
Validate LavaMoat policies on each PR (#19703)
* Validate LavaMoat policies on each PR

The LavaMoat policies are now validated on every PR. This makes it
easier to validate policy changes, as they should always correspond
with the changes made in the PR (unlike today, when they could be due
to a change in platform or a previous PR).

Closes #19680

* Update LavaMoat policies

---------

Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-06-23 09:50:36 -02:30
Nidhi Kumari
dfb830e862
removed portfolio link from wallet view (#19716)
* removed portfolio link from wallet view

* removed unused code

* updated test

* updated spec file

* updated test
2023-06-23 17:28:41 +05:30
António Regadas
80bfb5b501
[MMI] rearrange mmi account menu options (#19635)
* adds the portfolio dashboard option and compliance to the global menu

* undo change
2023-06-23 11:55:31 +02:00
António Regadas
93704a8479
fixes the stake a portfolio icons not showing (#19633) 2023-06-23 11:54:59 +02:00
António Regadas
adc02dd534
adds MMI blue fox svg (#19632) 2023-06-23 11:54:04 +02:00
António Regadas
ce3855f520
adds MMI name to the manifest name (#19617) 2023-06-23 11:53:00 +02: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
bd12ea733a
Fix autolock field to accept decimals in Firefox (#19653)
The autolock field on the Settings screen — the field that allows users
to set the duration that MetaMask will wait for until automatically
locking — does not always accept decimal numbers. This breaks the e2e
test for this feature as it attempts to set this field to "0.1".

More specifically, the React component responsible for this field passes
whatever the user inputs through the `Number` function immediately and
then uses this to repopulate the input. Therefore, if the user enters
"3" followed by a ".", `Number("3.")` will be called. This evaluates to
the number 3, and "3" becomes the new value of the field. As a result,
the "." can never be typed.

Curiously, this behavior only happens in Firefox; Chrome seems to
keep the "." in the input field when it's typed. This happens because
`onChange` event doesn't seem to get fired until a number is typed
*after* the ".". This may be due to underlying differences in the DOM
between Chrome and Firefox.

Regardless, always passing the input through `Number` creates other odd
behavior, such as the fact that the input can never be cleared (because
`Number("")` evaluates to 0).

This commit solves these problems by saving the "raw" version of the
user's input as well as the normalized version. The raw version is
always used to populate the input, whereas the normalized version is
saved in state.
2023-06-22 10:29:24 -06:00
Elliot Winkler
16dad66da9
Update Chromedriver to v114 (#19648) 2023-06-22 09:41:03 -05:00
David Walsh
329e4b75ed
Fix #19608 - Make account name validation more strict (#19616) 2023-06-22 09:07:56 -05:00
Vinicius Stevam
ed702af8ce
Add e2e tests for queuing multiple transactions (#19411) 2023-06-22 08:56:44 +01:00
David Walsh
7949ec9cd4
Fix #18423 - Ensure token details stay within dropdown (#19626)
* Fix #18423 - Ensure token details stay within dropdown

* Ellipsize the token id

* Add tooltip, fix tests
2023-06-21 16:28:53 -05:00
Elliot Winkler
b7f8c82edb
Copy missing lookupNetwork-related tests from core (#19431)
These tests were present in the core version of the NetworkController
tests, but not here. Add them makes it easier to visually compare
differences in the tests between core and this repo.
2023-06-21 13:52:01 -06:00
Gauthier Petetin
4ae483c6dd
fix(action): release branches pattern was not correct (#19709) 2023-06-21 15:10:04 -03:00
Elliot Winkler
bdd638400c
Shorten network type references in NC tests (#19430)
Update NetworkController tests to replace `NETWORK_TYPES.<NETWORK NAME>`
with `NetworkType.<network name>`. This makes it easier to visually
compare differences in the tests between core and this repo.
2023-06-21 11:31:08 -06:00
Elliot Winkler
2958c2230b
Reorder NetworkController tests to match core (#19429)
This makes it easier to visually compare differences in the
NetworkController unit tests between core and this repo.
2023-06-21 07:09:37 -07:00
Nidhi Kumari
76cafe0a83
added extra margin for unlocked state in full view in header (#19701)
Co-authored-by: Danica Shen <zhaodanica@gmail.com>
2023-06-21 19:32:25 +05:30
Gauthier Petetin
6f4584315d
feat(action): remove labels after PR closed (#19639) 2023-06-21 09:05:57 -03:00
Mark Stacey
20d79cf46e
Add bot command to update LavaMoat policies (#19675)
A bot command has been added that can update LavaMoat policies
automatically. This helps contributors without a Linux machine to
produce policy files that match exactly what CI expects.

The README has been updated with instructions for this new workflow.
2023-06-21 09:17:30 -02:30
Mark Stacey
e58e5e166b
Lint GitHub Action workflows (#19665)
* Lint GitHub Action workflows

We now lint GitHub Action workflows. This lint step is performed in the
`main` workflow, which has an "All jobs passed" check that we can add
further checks to in the future. This can grow to encompass all PR
status checks that depend upon the PR contents.

This workflow is based upon the one used in the MetaMask module
template.

* Fix branch names

* Fix lint error
2023-06-21 09:17:13 -02:30
Mark Stacey
4b08c02d9f
Update LavaMoat policy for MMI (#19683)
The LavaMoat policy for MMI has been updated to match what is generated
on CI.
2023-06-20 20:04:28 -02:30
Mark Stacey
b18ad861be
Use immutable install in fitness function workflow (#19678)
The fitness function workflow now uses an immutable install, ensuring
that the dependencies installed are known and tracked in the lockfile.
This makes it easier to audit exactly which dependencies were used for
each run.
2023-06-20 20:03:48 -02:30
Mark Stacey
d138882253
Remove unnecessary step from action workflow (#19677)
The `chmod` step has been removed from the GitHub Actions workflow for
adding release labels. The script has been made executable in the
repository instead (the file mode is tracked by git).
2023-06-20 20:03:24 -02:30
Mark Stacey
1cc599708a
Use nvmrc in GitHub Actions workflows (#19661)
The `nvmrc` file is now referenced in our GitHub Actions workflows,
rather than hard-coding the expected Node.js version. This will make
future Node.js version changes easier to manage.
2023-06-20 20:03:02 -02:30
Dhruv
bc1a15a0a3
Creating stories for LoadingHeartBeat and LoadingIndicator (#19495)
* Creating stories

* lint fix

* Updating LoadingHeartbeat story

---------

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2023-06-20 15:16:19 -07:00
Dhruv
ab0374d48a
Part of #18714: Replacing deprecated constants with enums (#19516)
* replacing deprecated constants with enums

* Removing redundant properties
2023-06-20 15:14:45 -07:00
Ujwal Kumar
84135f5d4c
Replace deprecated Display constant with enum in slippage-buttons.js (#19560) 2023-06-20 13:56:05 -07:00
rohit kerkar
639de748fb
Adding story for CancelButton (#19566)
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2023-06-20 13:44:54 -07:00
rohit kerkar
4a8a4aa01b
creating story for multilayer-fee-message & nft-options (#19567)
* creating story for multilayer fee message

* add story for nftoptions

* lint fixed

* suggestion

* Updating function props to actions in storybook

---------

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2023-06-20 13:43:27 -07: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
Pedro Figueiredo
ba6a27130e
add sonarqube to the extension (#19304) 2023-06-20 17:58:10 +01:00
Daniel
3e79a742c4
Only show a Swaps notification on a supported chain (#19673) 2023-06-20 18:57:14 +02: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
f854937249
Fix add-account e2e test (#19684)
The add-account e2e test was recently broken due to a conflict between
the PRs #19293 and #19546 (a function was renamed)
2023-06-20 16:33:24 +01:00
Dan J Miller
c76d91dfe7
Update changelog for v10.33.0 (#19664)
* Update changelog for v10.33.0

* Update CHANGELOG.md

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

* Update CHANGELOG.md

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

* Update CHANGELOG.md

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

* Update CHANGELOG.md

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

---------

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
2023-06-20 12:30:49 -02:30
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
Mark Stacey
9a70331dfc
Remove unused test data (#19597)
This file appeared to be unused, and the state in the file is very
outdated.
2023-06-20 11:37:05 -02:30
Mark Stacey
962eabd278
Rename the Crowdin workflow action (#19663)
The workflow file has been renamed to use kebab-case, as is the
convention for all of our other files.
2023-06-20 11:36:44 -02:30
Danica Shen
f10775f55d
feature(19625): eliminate e2e flakyness for add-account and send-eth (#19645)
* feature(19625): eliminate e2e flakyness for add-account and send-eth

* feature(19625): remove await delay in send-eth
2023-06-20 14:45:40 +01:00
David Walsh
ba3f86400c
Fix #19609 - Prevent rounded corners in account menu (#19615) 2023-06-20 08:38:24 -05:00
OGPoyraz
39089e0f4c
Accept SignController approval request from frontend (#19184) 2023-06-20 15:37:09 +02:00
Matthew Walsh
b247f272ba
Support translation in background code (#19650) 2023-06-20 13:44:11 +01: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
Mark Stacey
bce053f7ef
Update LavaMoat build policy (#19668)
The LavaMoat build policy has been updated to match what is generated
on CI.
2023-06-20 09:21:10 -02:30
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
Dan J Miller
ac3053d16a Run yarn lavamoat:auto for v10.33.0 2023-06-19 16:26:24 -02:30