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

13641 Commits

Author SHA1 Message Date
Mark Stacey
7226357422
Fix isMainnet propType error (#12951)
A propType error was showing up during e2e tests with a `testDev`
build. It was caused by `process.env.IN_TEST` being treated as a
boolean, when in fact it is either the string `'true'` or a boolean.

`IN_TEST` has been updated to always be a boolean. `loose-envify` has
no trouble injecting boolean values, so there's no reason to treat this
as a string.
2021-12-02 14:46:46 -03:30
Mark Stacey
fac68980e0
Fix signature request propTypes (#12952)
There were two propType errors in the signature request and signature
request footer components. A boolean was wrongly declared as a
function, and that same boolean was later declared with an invalid
propType (`PropTypes.boolean` rather than `PropTypes.bool`). Both
errors have been fixed.
2021-12-02 14:39:18 -03:30
Olaf Tomalka
90b656bd66
Added SiteOrigin and PermissionList components (#12832)
* Changed back button to the one in design

* PermissionConnect now uses Chip component

* Added SiteOrigin widget

* WIP

* Added new permission list

* Fix linting errors

* Removed unused messages

* Removed more unused messages

* Make SiteOrigin bigger

* Fix lint

* Code Review fixes

* Fix SiteOrigin overflowing

* Add stories

* Fix lint

* Added useMemo to constant

* Fix Chip's max-content overflowing SiteOrigin

* Fix code review issues

Co-authored-by: Olaf Tomalka <olaftomalka@Olafs-MacBook-Pro-2.local>
2021-12-02 18:22:18 +01:00
George Marshall
4cd957953d
Updating Storybook base styles (#12862)
* Adding branding and updating styles for storybook docs

* Making code blocks light gray
2021-12-02 09:11:35 -08:00
igorms-cons
6dbf6e3ab3
Latest update conversion date - issue #10741 (#12422)
* conversion date fix

* update in settings conversion date - no internet

* update conversionDate fetch - setting container

* no currency date message updated
2021-12-02 08:48:09 -03:30
Dan Miller
5542bdd23a Run yarn lavamoat:auto 2021-12-01 22:30:20 -03:30
Alex Donesky
b65005db84 put new collectibles related preferences behind feature flag (#12936) 2021-12-01 22:19:56 -03:30
Alex Donesky
3cff801b8e Revert "Feat/collectibles display (#12873)" (#12934)
This reverts commit 81ea24f08a.
2021-12-01 22:19:54 -03:30
Alex Donesky
9e2935dd55
Revert "Feat/collectibles display (#12873)" (#12934)
This reverts commit 81ea24f08a.
2021-12-01 17:46:26 -06:00
Hassan Malik
79867bcebe
Adding snaps authorship pill (#12740)
* added npm icon

* added snaps-authorship-pill component and story

* updated npm icon

* added classname

* added comments

* changed label to an h7

* updated default label, removed unnecessary font-weight prop

* moved npm icon to flask/icons and added storybook file

* added hover/focus logic

* updated hover logic

* updated hover logic

* added authorship pill scss to app-components, removed unnecessary handlers

* removed npm icon, added font-awesome icon, added font-awesome brands to scss imports

* removed icons directory, updated scss file to use the proper color for npm icon, updated component with correct size and added class to change color

* fixed linter errors

* added link to pill and its story, changed title of story

* changed link to open in new tab, moved classname to root element and made it inline-block

* fixed proptype comment

* fixed linter error
2021-12-01 17:45:55 -05:00
Alex Donesky
c29afd110b
put new collectibles related preferences behind feature flag (#12936) 2021-12-01 16:10:24 -06:00
Dan Miller
0563c471a6 Update changelog for v10.8.0 2021-12-01 18:18:46 -03:30
George Marshall
eb4f051b23
Adding SnapSettingsCard ui component (#12655)
* parent d89e5336a6
author georgewrmarshall <george.marshall@consensys.net> 1636692862 -0800
committer hmalik88 <hassan.malik@consensys.net> 1637342043 -0500

Initial SnapSettingsCard component

Updates to styles but having specificity issues so increased specificity

Updates to styles but having specificity issues so increased specificity

added overflow fix and added tests

lockfile update

prettier fix

added stylelint ignore

yarn.lock fixed

* merge conflict fix

* package/yarn fix

* fixed package.json

* updated lockfile...

* removed comment

* removed unnecessary key/val for chip status indicator color

* bumped lattice to 0.4.0 in package json, fixed yarn lock

* removed dupe entry in yarn lock

* ran yarn setup to update lock file

* updated chip label prop

* parent d89e5336a6
author georgewrmarshall <george.marshall@consensys.net> 1636692862 -0800
committer hmalik88 <hassan.malik@consensys.net> 1637342043 -0500

Initial SnapSettingsCard component

Updates to styles but having specificity issues so increased specificity

Updates to styles but having specificity issues so increased specificity

added overflow fix and added tests

lockfile update

prettier fix

added stylelint ignore

yarn.lock fixed

* merge conflict fix

* package/yarn fix

* fixed package.json

* updated lockfile...

* removed comment

* bumped lattice to 0.4.0 in package json, fixed yarn lock

* removed dupe entry in yarn lock

* ran yarn setup to update lock file

* Using IconWithFallback instead of SiteIcon, fixing icon prop, and adding status story and docs page

* Updating to follow storybook folder convention

* Updates to styles

* Adding localization

* added todo comment

Co-authored-by: hmalik88 <hassan.malik@consensys.net>
2021-12-01 16:10:51 -05:00
George Marshall
854fc71ae7
Organizing storybook to echo app folder structure (#12796)
* Organizing storybook to echo app folder structure

* Updating new stories to follow new convention from develop
2021-12-01 11:27:57 -08:00
MetaMask Bot
9262670dfe Version v10.8.0 2021-12-01 19:13:15 +00:00
Mark Stacey
267cdc4e6b
Update Jest coverage reporters (#12845)
The coverage reporter for the console has been changed from `text` to
`text-summary` because `text` was too long. It exceeded the maximum
length of the CircleCI terminal output shown on their jobs page, making
it very difficult to see why the unit test coverage job failed.

The text summary only displays overall coverage metrics, but that is
usually enough to indicate when the test fails due to a drop in
coverage. The more detailed breakdown is still available as a HTML
report linked in the `metamaskbot` comment, and in the `jest-coverage`
directory when run locally.

The three on-disk coverage reports used previously (`lcov`, `json`, and
`clover`) have been replaced with just `html`. The HTML report was part
of the `lcov` report, and it was the only one we were using.
2021-12-01 15:16:34 -03:30
Mark Stacey
b6b202ca13
Convert nonce background calls to async/await (#12853)
The calls to the background in `actions.js` that relate to the custom
nonce feature now use `async/await` and `promisifiedBackground`.

The behaviour should be unchanged except that when setting the nonce
field, the warning is shown in case of error before the loading
indicator drops, which seems like it would be a minor improvement (if
it has any user-facing impact at all).
2021-12-01 15:16:10 -03:30
PeterYinusa
9babc8b804
update chromedriver to v96 (#12921) 2021-12-01 18:21:29 +00:00
Alaa Hadad
e056c88ba7
Feature: Transaction Insights (#12881)
* integration for tx decoding confirmation and history view

* upgrading @truffle/decoder to latest release 5.1.0

* Update acorn and colors patches

* feat: remove redundant styling

* feat: basic integration for nickname components

* feat: wiring functionality of adding new nickname

* feat: wire functionality of showing nickname modal

* feat: link the nickname popover with add/update popover

* feat: moving forward with address nicknames integration

* feat: fixing a bug related to passing chainId in addressBook

* feat: populating memo prop in addressbook entry

* feat: add explorer link

* feat: bug fixing update nickname component

* feat: fix proptypes

* feat: adding tooltip for copying nickname address

* featL fix styling for tx-details page

* feat: optimize code for error handling

* feat: limiting transaction decoding to tx with data

* feat: remove tree UI component

* feat: adding request to check for tx decoding supported networks

* feat: showing data hex component

* feat: fix react warnings

* feat: remove extra margin in tx decoding

* Remove unused package @truffle/source-map-utils

* Ensure messages get translated

* feat: link tx-decoding addresses with nicknames

* Omit value for boolean attributes

* Fix props reading in CopyRawData

* fix: fixing issue with transaltion

* Fix lint errors in TransactionDecoding

- Remove unused import
- Reorder imports
- Address conflict between caught `error` and error state flag by
  renaming state flag to `hasError`
- Fix requestUrl identifier casing and use of template string
- Ensure `useEffect` gets passed the deps it needs
- Add scope braces around case statement where it's needed
- Omit literal `true` for boolean jsx attribute
- Refactor nested ternary as `if` statements

* fix: revert fetchWithCache modifications

* Fix linting for TransactionListItemDetails

- Remove unused import
- Fix import spacing
- Remove unused prop dereference
- Fix string interpolation for translated From/To

* Moving to popover pattern

* fix: sass color variable

* Omit value for boolean attribute

* Remove changes from modal.js

* fix: refactor nickname popovers

* Ensure const gets declared before it's used

* Fix linting for ConfirmTransactionBase

- Remove unused prop chainId
- Stop destructuring an unused field

* fix: refactor usage of nicknames popovers in send-content-container

* fix: remove extra prop updateAccountNicknameModal

* fix: refactor code for address.component

* fix: remove extra tooltip

* Ensure NicknamePopovers always returns component

* Fix linting for NicknamePopover component

- Fix useCallback deps
- Switch ternary to logical-or

* Fix linting for SenderToRecipient

... by fixing import order

* Remove unused addressCopied state

* Delete empty file

* fix: remove sender-to-recipient.container

* fix: refactor usage of nickname popovers in confirm-page-container

* fix: bug related to state variable

* Stylelint fix

* Lint fix

* Change "Total Amount" to "Total"

* Lint fix locales

* Update address-book.spec.js

* e2e test update

* Update e2e tests

* Fix issue where absence of function params in data hex tab would result in rendering a  string

* Fix border radius, and width and height in small notification windows, of the update-nickname-popover

* Remove fake await

* Clean up

* Clean up

Co-authored-by: Alaa Hadad <alaahd@Alaas-MacBook-M1-Pro-14-inch.local>
Co-authored-by: Dan Miller <danjm.com@gmail.com>
Co-authored-by: g. nicholas d'andrea <gnidan@trufflesuite.com>
2021-12-01 13:52:08 -03:30
Mark Stacey
fb60b14367
Merge pull request #12917 from MetaMask/master-sync
Sync develop with master
2021-12-01 13:48:35 -03:30
Olaf Tomalka
70386726f6
Implement Flask onboarding UI (#12745)
* Added Flask Experimental Area warning to OnboardingV2

* Added first time flow Flask Experimental Area warning

* Made both onboarding flows use one Experimental Area component

* Fix comments in React divs

* Fix unreachable code

* Fix build lint problems

* Changes after code review

* Added guards around route constants imports

* Code Review changes

* Update ui/components/app/flask/experimental-area/index.scss

Co-authored-by: George Marshall <george.marshall@consensys.net>

* Code review changes

* Fix lint

* Update ui/components/app/flask/experimental-area/index.scss

Co-authored-by: George Marshall <george.marshall@consensys.net>

* Update ui/components/app/flask/experimental-area/index.scss

Co-authored-by: George Marshall <george.marshall@consensys.net>

* Update ui/components/app/flask/experimental-area/index.scss

Co-authored-by: George Marshall <george.marshall@consensys.net>

* Update ui/components/app/flask/experimental-area/index.scss

Co-authored-by: George Marshall <george.marshall@consensys.net>

* Update ui/components/app/flask/experimental-area/index.scss

Co-authored-by: George Marshall <george.marshall@consensys.net>

* fix lint

Co-authored-by: George Marshall <george.marshall@consensys.net>
2021-12-01 17:53:30 +01:00
Matthew Epps
7a92e22111
Swaps optimizations (#12842)
* Trigger Build

* Trigger Build

* Move swaps index variables to redux

* all optimizations so far

* Add better equality checks for selectors in swaps index and build quote

* Clean up PR, remove extra code and logs

* Clean up lavamoat file

* Fixes for optimizations

* Update tests and test snapshots

* Remove unnecessary tests

* Remove unnecessary console log

* Trigger Build

* Trigger Build

* Add delay to account for remote call made by trezor keyring

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2021-12-01 12:55:09 -03:30
Alex Donesky
81ea24f08a
Feat/collectibles display (#12873)
* Wiring up Collectibles lists/items

* wip

* more wip

* more more wip

* yet more wip

* wippp

* more wipppp

* closer

* wroking

* more wip

* cleanup

* cleanup

* add-collectible form validation

* update default ipfs-gateway

* update refresh button

* fix proptypes issue + add more padding to asset background

* css tweaking

* more cleanup

* more cleanup

* more cleanup

* add migration

* address feedback

* fix migration + cleanup

* bumping controllers version + adapting new collectiblesController shape

* fix yarn dedupe
2021-12-01 10:10:17 -06:00
Dan Miller
bbf4d23fcc Merge branch 'develop' into master-sync 2021-12-01 10:12:56 -03:30
Dan J Miller
91f0ec1bab
Merge pull request #12732 from MetaMask/Version-v10.7.0
Version v10.7.0 RC
2021-12-01 04:38:30 -03:30
Thomas Huang
1a81ae8b19 Update Changelog 2021-11-30 22:36:44 -06:00
kumavis
39d5afb3c1
deps - bump lavamoat for logging bug fix (#12915) 2021-11-30 18:23:30 -10:00
Alex Donesky
3434b9f80a
add openSeaEnabled preference (#12909)
* add openSeaEnabled preference

* cleanup

* add description copy
2021-11-30 22:12:27 -06:00
Dan J Miller
e25c34e86b
Add delay to account for remote call made by trezor keyring (#12913) 2021-11-30 21:24:33 -03:30
Jyoti Puri
a020281c96
Implementing save button on advance gas fee modal (#12854) 2021-12-01 06:01:21 +05:30
Matthew Epps
8e6a0ff879
Send all swaps requests to api2, remove useNewSwapsApi boolean (#12792)
* Send all swaps requests to api2, remove useNewSwapsApi boolean

* Switch token bucket priority

* Fix tests

* Trigger Build

* Trigger Build
2021-11-30 19:56:28 +01:00
Mark Stacey
d0c1fd713d
Remove invalid Jest storybook coverage config (#12846)
The Jest storybook config was mistakenly set to overwrite the coverage
report for our main set of Jest tests. It also had extremely high
coverage thresholds set, and the `collectCoverageFrom` config was
asking Jest to check that the storybook tests cover all of the UI code.

For now the `collectCoverageFrom` config has been removed. I don't
understand why we'd want to use Storybook to unit test in the first
place, so I don't understand what parts of the codebase we'd want to
cover with these tests. So for the moment, only the files touched by
the current tests are considered.

The coverage output directory is now set to `jest-coverage/storybook`
so that it does not overlap with any other coverage reports.
2021-11-30 14:52:07 -03:30
Thomas Huang
b32bccc11e
Format shared/modules/*.tests to use jest arrow functions and use stricter comparative matcher (#12908) 2021-11-30 12:09:46 -06:00
Mark Stacey
8835642c6d
Remove unnecessary unlock step (#12840)
As part of the unlock process, currently the seed phrase is retrieved
from the background then discarded. This step is pointless, so it has
been deleted.
2021-11-30 12:13:49 -03:30
Dan J Miller
b025baf093 Adds multilayer fee display to erc20 token approval screen (#12824)
* Adds multilayer fee display to erc20 token approval screen

* Change bold property name
2021-11-30 11:51:23 -03:30
Dan J Miller
2856ea7606
Add support for eip-1559 on Trezor (#12627)
* Add support for eip-1559 on Trezor

* temp

* Lint fix

* Store trezor model type in background state instead attempting to get it in the frontend

* code simplification

* Temp update to eth-trezor-keyring version

* Tempory update to eth-trezor-keyring version

* Temp update to eth-trezor-keyring version

* Fix display of hdpath selector in connect hardware flow for trezor

* Updating the package version but we still need to run yarn setup and update the lockfile, once the package is updated

* Update yarn.lock

* Fix unit tests
2021-11-30 10:58:28 -03:30
Dan J Miller
9aa8abb55f Remove _removeBeforeUnload calls in confirm-encryption-public-key.component.js and confirm-decrypt-message.component.js (#12825) 2021-11-29 19:33:54 -03:30
Dan J Miller
7400b16cf2 Use node-browsers-medium-plus executor for validate-lavamoat-config job (#12884) 2021-11-29 17:35:31 -03:30
Dan J Miller
76158bf26b
Use node-browsers-medium-plus executor for validate-lavamoat-config job (#12884) 2021-11-29 17:34:51 -03:30
VSaric
35c1eaa2bd
Created a Nickname popover (#12632)
* Created a Nickname popover

* Fixing lines in index.scss

* Handle copy button and fix some paddings

* Added text to be editable in the storybook component

* Simplify nickname scss and html

* Delete harcoded address

* Change color usage with new color system
2021-11-29 16:05:56 -03:30
Jyoti Puri
7ace0497c8
Removing un-necessary comma (#12883)
* Confirm transaction screen style fixes
2021-11-30 00:32:54 +05:30
Niranjana Binoy
3f8cbd5202
Removing the token detection announcement when the token detection is ON (#12776) 2021-11-29 13:28:35 -05:00
Niranjana Binoy
4b975adc85
EIP-1559 V2 : Advanced gas fee modal - Max base fee and Priority fee inputs (#12619) 2021-11-29 23:10:48 +05:30
Dan J Miller
c2ea04c775
Adds multilayer fee display to erc20 token approval screen (#12824)
* Adds multilayer fee display to erc20 token approval screen

* Change bold property name
2021-11-29 13:23:37 -03:30
Jyoti Puri
0e0e7ac830
Legacy transactions to use old transaction flow (#12782) 2021-11-29 21:38:24 +05:30
Mark Stacey
19a8b58aa1 Fix environment variables used during test builds (#12855)
The environment variables used for test builds was wrong for certain
bundles because the `testing` flag wasn't passed through to the
function that determines which environment variables to inject.
Effectively this means that test builds on `master` were going to the
production `metamask` Sentry project rather than the `test-metamask`
project. This has been the case since #11080.

The `testing` flag is now included for all bundles, and test builds now
use the `test-metamask` Sentry project in all cases.
2021-11-26 17:33:03 -03:30
Mark Stacey
9fd42f1bc2 Fix LavaMoat background policy generation (#12844)
The LavaMoat policy generation script would sporadically fail because
it ran the build concurrently three times, and the build includes
steps that delete the `dist` directory and write to it. So if one build
process tried to write to the directory after another deleted it, it
would fail.

This was solved by adding a new `--policy-only` flag to the build
script, and a new `scripts:prod` task. The `scripts:prod` task only
runs the script tasks for prod, rather than the entire build process.
The `--policy-only` flag stops the script tasks once the policy has
been written, and stops any other files from being written to disk.

This prevents the three concurrent build processes from getting in each
others way, and it dramatically speeds up the process.
2021-11-26 17:14:24 -03:30
Mark Stacey
e8b7fcf8dc
Fix LavaMoat background policy generation (#12844)
The LavaMoat policy generation script would sporadically fail because
it ran the build concurrently three times, and the build includes
steps that delete the `dist` directory and write to it. So if one build
process tried to write to the directory after another deleted it, it
would fail.

This was solved by adding a new `--policy-only` flag to the build
script, and a new `scripts:prod` task. The `scripts:prod` task only
runs the script tasks for prod, rather than the entire build process.
The `--policy-only` flag stops the script tasks once the policy has
been written, and stops any other files from being written to disk.

This prevents the three concurrent build processes from getting in each
others way, and it dramatically speeds up the process.
2021-11-26 16:38:23 -03:30
Alex Donesky
5aa191fd2e
Feat/add collectible manually (#12834)
* hook up add collectible manually flow

* address feedback
2021-11-26 14:03:35 -06:00
Mark Stacey
609f541b76
Fix environment variables used during test builds (#12855)
The environment variables used for test builds was wrong for certain
bundles because the `testing` flag wasn't passed through to the
function that determines which environment variables to inject.
Effectively this means that test builds on `master` were going to the
production `metamask` Sentry project rather than the `test-metamask`
project. This has been the case since #11080.

The `testing` flag is now included for all bundles, and test builds now
use the `test-metamask` Sentry project in all cases.
2021-11-26 15:39:32 -03:30