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

15008 Commits

Author SHA1 Message Date
Frederik Bolding
7fc418a96d
[FLASK] snaps-skunkworks@0.20.0 (#15706)
* snaps-skunkworks@0.20.0

* Generate LavaMoat policy

* Fix some breaking changes

* Update iframe execution env

* Fix unit tests

* Implement snap_getBip44Entropy

* Regenerate LavaMoat policy

* Prefer ControllerMessenger over direct calls

* Fix not showing warning for BIP44 legacy permission and E2E test

Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
2022-08-26 13:48:53 +02:00
PeterYinusa
fe78890dd2
Sentry e2e test (#15715) 2022-08-25 18:07:31 -05:00
Adnan Sahovic
341f761dd7
Created a new token component (#15617)
Co-authored-by: ryanml <ryanlanese@gmail.com>
2022-08-25 18:01:30 -05:00
Alex Miller
21e3b4785d
[GridPlus] Version bump (#15711)
* [GridPlus] Bumps packages
Significant updates:
* Reverts build system changes to reduce bundle size (`gridplus-sdk` #461)
* Adds support for nested ABI definitions if firmware allows it (`gridplus-sdk` #462, #450)
Full changes:
* `eth-lattice-keyring`: https://github.com/GridPlus/eth-lattice-keyring/compare/v0.11.0...v0.12.0
* `gridplus-sdk`: https://github.com/GridPlus/gridplus-sdk/compare/v2.2.2...v2.2.7

* [GridPlus] Lavamoat changes
2022-08-25 18:11:17 -02:30
Mark Stacey
92a7f2c615
Merge pull request #15710 from MetaMask/master-sync
Sync v10.18.4 with `develop`
2022-08-25 10:54:10 -04:00
mirjanaKukic
eabbe9f037
add e2e test for default icons (#13869) 2022-08-25 09:48:13 -05:00
Mark Stacey
a1cda8ad9d Merge remote-tracking branch 'origin/develop' into master-sync
* origin/develop: (228 commits)
  Update `object.values` patch (#15692)
  chore: Adjust trailing whitespace (#15636)
  updated casing in import Token for spanish (#15687)
  development scripts: add node shebang; mark as executable (#15655)
  Created a new contract details modal (#15549)
  Token allowance improvements feature flag (#15646)
  Updated origin pill component to match the new design (#15603)
  Update `depcheck` to latest version (#15690)
  Replace `lavamoat-runtime.js` patch (#15682)
  upgrade jest (#15642)
  Fix Sentry deduplication of events that were never sent (#15677)
  Jest configuration fix (#15673)
  Header component for transaction confirmation screens (#15614)
  New network info popup (#13319)
  Consolidating Zendesk URLs in to constants file (#15669)
  Created review spending cap component (#15633)
  Fix Sentry in LavaMoat contexts (#15672)
  Fix LavaMoat policy generation script (#15668)
  Using formatIconUrlWithProxy to get the iconUrl proxy of swap token (#15562)
  Migrate app constants to typescript (#15611)
  ...
2022-08-25 11:03:29 -02:30
Mark Stacey
ee06fe495c
Update object.values patch (#15692)
The package `object.values` was updated in #15293 but we forgot to
update the patch. This was resulting in a warning on the command line
upon each install.

The patch was still applied successfully, so no changes were needed
other than updating the version.
2022-08-24 12:46:37 -07:00
legobeat
ef9d5d117b
chore: Adjust trailing whitespace (#15636)
Co-authored-by: ryanml <ryanlanese@gmail.com>
2022-08-24 14:11:49 -05:00
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
Nidhi Kumari
82ce1b02c7
updated casing in import Token for spanish (#15687)
Co-authored-by: ryanml <ryanlanese@gmail.com>
2022-08-24 23:54:30 +05:30
legobeat
2a1c4a00f1
development scripts: add node shebang; mark as executable (#15655) 2022-08-24 12:25:27 -05:00
Adnan Sahovic
69b5505a1c
Created a new contract details modal (#15549)
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2022-08-24 12:12:52 -05:00
Filip Sekulic
47d61c6832
Token allowance improvements feature flag (#15646) 2022-08-24 11:04:36 -05:00
VSaric
9a359b87d1
Updated origin pill component to match the new design (#15603) 2022-08-24 11:02:18 -05:00
Mark Stacey
2140a12b06
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.
2022-08-24 12:42:30 -02:30
Mark Stacey
35dbdbc438
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.
2022-08-24 09:50:45 -02:30
Brad Decker
0d862d4032
upgrade jest (#15642) 2022-08-23 15:13:02 -05:00
Mark Stacey
1f36ba4b75
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.
2022-08-23 16:14:14 -02:30
Jyoti Puri
5a25084eab
Jest configuration fix (#15673) 2022-08-23 23:27:55 +05:30
Filip Sekulic
6185cc6e5e
Header component for transaction confirmation screens (#15614)
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2022-08-23 10:52:08 -05:00
Filip Sekulic
365bf11fdd
New network info popup (#13319) 2022-08-23 10:04:07 -05:00
ryanml
4dab986ad2
Consolidating Zendesk URLs in to constants file (#15669) 2022-08-23 09:19:31 -05:00
VSaric
4424686a3c
Created review spending cap component (#15633) 2022-08-23 08:53:53 -05:00
Mark Stacey
d55507615c
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.
2022-08-23 11:12:50 -02:30
Mark Stacey
22552a0152
Fix LavaMoat policy generation script (#15668)
Recently in #15468 the name of the scripts task used by the LavaMoat
policy generation script was renamed from `scripts:prod` to
`scripts:dist`, but we neglected to change this name in the LavaMoat
policy generation script itself.

The script task has now been updated so that the script works again,
and the LavaMoat policy generation script has been re-run.
2022-08-22 21:22:47 -02:30
Niranjana Binoy
4512a9e151
Using formatIconUrlWithProxy to get the iconUrl proxy of swap token (#15562) 2022-08-22 15:16:57 -04:00
Brad Decker
aac5a45bec
Migrate app constants to typescript (#15611) 2022-08-22 10:42:58 -05:00
ryanml
362f8c2a94
Updating Customize Nonce 'Learn More' link (#15658) 2022-08-22 08:38:03 -07:00
ryanml
6882f0b8c0
Ensuring Blockies icon is used in recipient details when enabled (#15662) 2022-08-22 07:40:59 -07:00
ryanml
c6cdf924d2
Fixing Contacts breadcrumb when viewing contact details (#15663) 2022-08-22 07:40:41 -07:00
ryanml
1772deeea9
Fixing Blockies identicon option alignment (#15652) 2022-08-19 17:37:34 -07:00
Daniel
0cbff07b61
Remove unnecessary event props, update STX controller version (#15653)
* Remove unnecessary event prop
* Update STX controller version
* yarn yarn-deduplicate
2022-08-19 22:27:49 +02:00
ryanml
3fefb68c69
Fixing token detection grammar (#15644)
* Fixing token detection grammar

* Unused locale cleanup
2022-08-19 13:19:15 -07:00
Mark Stacey
48c02ef641
Add validation to production build script (#15468)
Validation has been added to the build script when the "prod" target is
selected. We now ensure that all expected environment variables are
set, and that no extra environment variables are present (which might
indicate that the wrong configuration file is being used).

The `prod` target uses a new `.metamaskprodrc` configuration file. Each
required variable can be specified either via environment variable or
via this config file. CI will continue set these via environment
variable, but for local manual builds we can use the config file to
simplify the build process and ensure consistency.

A new "dist" target has been added to preserve the ability to build a
"production-like" build without this validation.

The config validation is invoked early in the script, in the CLI
argument parsing step, so that it would fail more quickly. Otherwise
we'd have to wait a few minutes longer for the validation to run.
This required some refactoring, moving functions to the utility module
and moving the config to a dedicated module.

Additionally, support has been added for all environment variables to
be set via the config file. Previously the values `PUBNUB_PUB_KEY`,
`PUBNUB_SUB_KEY`, `SENTRY_DSN`, and `SWAPS_USE_DEV_APIS` could only be
set via environment variable. Now, all of these variables can be set
either way.

Closes #15003
2022-08-19 15:46:18 -02:30
ryanml
f26d2db338
Fix stray space/period in Custom Token warning text (#15650) 2022-08-19 08:50:29 -07:00
legobeat
1d0ef3e321
chore: Complete node16 upgrade (#15634)
Follow-up from #15131
2022-08-19 22:35:52 +08:00
Jyoti Puri
637d4bcf2c
Adding unit test case to for idempotent behaviour of importAccountWithStrategy idempotent (#15583) 2022-08-19 08:43:08 -05:00
Jyoti Puri
29e252e162
Add unit test coverage to ensure that addToken method is idempotent. (#15587) 2022-08-19 18:00:40 +05:30
Erik Marks
8210e3a812
Convert LavaMoat policy generation script to Yargs application (#15626)
This PR converts `generate-lavamoat-policies.sh` to `.js` using Yargs. This makes it easier to only generate policy files for a specific build type (using the `-t` flag), which is often useful during Flask development. In addition, the `lavamoat:background:auto` scripts are renamed, and the main readme is updated with some useful tips.

Note that `lavamoat:background:auto:dev` is removed and `lavamoat:background:auto` should be used during local development.
2022-08-18 16:09:26 -07:00
dependabot[bot]
ba376c07c1
Bump @metamask/providers from 9.0.0 to 9.1.0 (#15514)
Bumps [@metamask/providers](https://github.com/MetaMask/providers) from 9.0.0 to 9.1.0.
- [Release notes](https://github.com/MetaMask/providers/releases)
- [Changelog](https://github.com/MetaMask/providers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/MetaMask/providers/compare/v9.0.0...v9.1.0)

---
updated-dependencies:
- dependency-name: "@metamask/providers"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-18 19:09:08 -02:30
John Brennan
1c9764a6a2
Fix onboarding events (#15608) 2022-08-18 16:31:07 -05:00
Jyoti Puri
f15d8e2f9b
Add test case to ensure that action addCustomNetwork is idempotent (#15602) 2022-08-19 01:09:04 +05:30
Nidhi Kumari
f2514c88cf
added avatar network component (#15502)
* added avatar network component

* reset showFallback if networkUrl changes

* updated changed to avatar network

* updated test cases for avatar network

* updated story url in README

* added avatar network class Name

* updated readme for AvatarNetwork

* updated avatar network

* updated text changes to avatar Network and Avatar Token component

* updated space between useState and useEffect

* updated scss files in alphabetic order
2022-08-19 00:24:10 +05:30
Alex Donesky
94180e850e
filter breadcrumbs for improved clarity while debugging sentry errors (#15639) 2022-08-18 13:38:59 -05:00
Dan J Miller
fc232da4c4
Fix state creation in setupSentryGetStateGlobal (#15635) 2022-08-18 15:25:28 -02:30
Garrett Bear
d25f9cf4da
UI-14395: typography v2 (#15408)
UI-14395: change Typography v2 to Text

UI-14395: upgrade design tokens

UI-14395: add classname testing

UI-14395: update text colors, update font family name to match token, update text storybook boxprops

UI-14395: add text transform docs

lint fix
2022-08-18 10:51:53 -07:00
Nidhi Kumari
119a5a4dc4
added avatar token component (#15466)
* added avatar token component

* added avatar token component story

* added avatar token readme to story

* added avatar token readme to story

* added halo effect

* added test to avatar token component

* fixed alt name

* added test for blur

* added test for aria hidden element

* fixed fallback issue

* updated halo id in README

* added changes to avatar token stories

* updated stories and README in storybook

* fixed indentation in stories

* changed component name structure

* updated css for avatar halo image

* updated README for Avatar Base Component

* added className to avatar Token

* Updates to docs and styles

* fixed tests for Avatar Token

* added color to the props

* fixed table props issue

* updated avatar token Readme

* updated args in avatar token stories

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2022-08-18 22:00:19 +05:30
Dan J Miller
ce35a204b2
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>
2022-08-18 13:33:23 -02:30
Ariella Vu
34eeea26f3
Fix Signature Request styles (#15621)
* SignatureRequestOriginal: fix collapsing ui

* SignatureRequestOrigin: fix collapsing icon
2022-08-18 23:54:44 +08:00