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

6906 Commits

Author SHA1 Message Date
Frederik Bolding
b0ac8f179f [FLASK] Unblock personal_sign for snaps (#19998)
* Add snap legacy authorship header

* Add legacy snap header to personal_sign

* Disable SIWE for snaps

* Add comment
2023-08-19 07:05:38 -02:30
Frederik Bolding
d40306f295 [FLASK] snaps@0.37.1-flask.1 (#20069)
* snaps@0.37.0-flask.1

* Update LavaMoat policies

* Add support for disabling markdown

* Update execution env URL

* Bump patch version
2023-08-19 07:05:37 -02:30
Dan J Miller
313deae6d1 Merge remote-tracking branch 'origin/master' into Version-v10.35.0 2023-08-18 21:13:57 -02:30
Dan J Miller
c2163434db Fix and test log.info calls run for each migration (#20517)
* Fix and test log.info calls run for each migration

In migrator/index.js, log.info is called before an after each migration.
These calls are intended to produce breadcrumbs to be captured by sentry
in cases where errors happen during or shortly after migrations are run.
These calls were not causing any output to the console because the log.setLevel
calls in ui/index.js were setting a 'warn value in local storage that was being
used by logLevel in the background.

This commit fixes the problem by setting the `persist` param of setLevel to
false, so that the background no longer reads the ui's log level.

Tests are added to verify that these logs are captured in sentry breadcrumbs
when there is a migration error due to an invariant state.

* Improve breadcrumb message matching

The test modified in this commit asserts eqaulity of  messages from breadcrumbs
and hard coded expected results. This could cause failures, as sometimes the
messages contain whitespace characters. This commit ensures the assertions only
check that the expected string is within the message string, ignoring extra
characters.
2023-08-18 11:16:42 -02:30
Mark Stacey
80746e67b5 Improve Sentry state pre-initialization (#20491)
* Improve Sentry state pre-initialization

Previously the masked state snapshot sent to Sentry would be blank for
errors that occured during initialization. Instead we'll now include
some basic information in all cases, and a masked copy of the persisted
state if it happens after the first time the persisted state is read.

* Add test

* Fix crash when persisted state not yet fetched

* Add descriptions for initial state hooks

* Update comments to reflect recent changes

* Re-order imports to follow conventions

* Move initial state hooks back to module-level

The initial state hooks are now setup at the top-level of their module.
This ensures that they're setup prior to later imports. Calling a
function to setup these hooks in the entrypoint module wouldn't
accomplish this even if it was run "before" the imports because ES6
imports always get hoisted to the top of the file.

The `localStore` instance wasn't available statically, so a new state
hook was introduced for retrieving the most recent retrieved persisted
state.

* Fix error e2e tests
2023-08-17 14:22:31 -02:30
Mark Stacey
d610aad2fd Split Sentry mask into UI and background masks (#20426)
The state mask used to anonymize the Sentry state snapshots has been
split into UI and background masks. This was done to simplify later
refactors. There should be no functional changes.
2023-08-16 22:54:59 -02:30
Mark Stacey
594dde58b1 Add additional Sentry E2E tests (#20425)
* Reorganize Sentry error e2e tests

The tests have been reorganized into different describe blocks. Each
describe block is for either before or after initialization, and either
with or without opting into metrics.

This was done to simplify later test additions. The conditions for each
test are now in the describe block, letting us test additional things
in each of these conditions. The conditions were flattened to a single
level to avoid excessive indentation.

* Add error e2e test for background and UI errors

The Sentry e2e tests before initialization only tested background
errors, and the after initialization tests only tested UI errors. Now
both types of errors are tested in both scenarios.

* Add error e2e tests for Sentry error state

E2E tests have been added to test the state object sent along with each
Sentry error.

At the moment this object is empty in some circumstances, but this will
change in later PRs.

* Rename throw test error function

* Only setup debug/test state hooks in dev/test builds

The state hooks used for debugging and testing are now only included in
dev or test builds. The function name was updated and given a JSDoc
description to explain this more clearly as well.

* Add state snapshot assertions

State snapshot assertions have been added to the e2e error tests. These
snapshots will be very useful in reviewing a few PRs that will follow
this one.

We might decide to remove these snapshots after this set of Sentry
refactors, as they might be more work to maintain than they're worth.
But they will be useful at least in the short-term.

The login step has been removed from a few tests because it introduced
indeterminacy (the login process continued asynchronously after the
login, and sometimes was not finished when the error was triggered).

* Ensure login page has rendered during setup

This fixes an intermittent failure on Firefox

* Format snapshots with prettier before writing them

* Use defined set of date fields rather than infering from name

* Remove waits for error screen

The error screen only appears after a long timeout, and it doesn't
affect the next test steps at all.
2023-08-16 14:46:53 -02:30
Dan J Miller
b74ab3f26c Merge remote-tracking branch 'origin/master' into Version-v10.35.0 2023-08-14 14:31:37 -02:30
David Walsh
19e2296131 Fix #20140 - Ensure only one network displays as selected in the network picker when chain IDs collide (#20152) 2023-08-14 13:58:13 -02:30
David Walsh
62f0e0955f Fix #20184 - Prevent overflow within the activity list (#20188)
* Fix #20184 - Prevent overflow within the activity list

* removing inline style, updating snap

---------

Co-authored-by: Victor Thomas <10986371+vthomas13@users.noreply.github.com>
2023-08-14 13:57:18 -02:30
Dan J Miller
723d8bb51e Fix opening of speedup popover in activity list (in the popup view) (#20205)
* Set height of activity-list-item rightContent to Blocksize.min, so that the element doesn't overlap buttons

* Fix unit test

---------

Co-authored-by: Brad Decker <bhdecker84@gmail.com>
2023-08-14 13:55:58 -02:30
Daniel
87b3ac62f1 Improvements to Swaps quote auto-selection logic, fix and edge case with zero-balance tokens (#20388)
* Add Token To into assets again (reverting commit 51f46eb65f48bdf4980f400a589bf1ac63a65222 )

* Update cleanup for an unswapped Token To from the Tokens list

* Call "setLatestAddedTokenTo" conditionally

* Update an E2E test for insufficient balance notification
2023-08-03 18:22:17 -02:30
David Walsh
eda24aab4f Fix 'Global Menu Explorer / Account Details' What's New (#20371) 2023-08-03 13:49:32 -02:30
Howard Braham
3c65b3fa7f fix(clipboard): Increase DEFAULT copy to clipboard time (#20008) 2023-07-27 15:59:16 -02:30
Nicholas Ellul
51cad751de Add improved downloading logic when exporting state logs (#19872)
* Add improved downloading logic when exporting state logs

* Make test for state logs download only apply to firefox

* Remove eslint override

* Add file extension to test

* Move make jest global.Blob accessible to window
2023-07-27 15:45:51 -02:30
David Walsh
5db22ceb84 UX: Ensure currently selected account displays when Account Menu opens (#20166)
* UX: Ensure currently selected account displays when Account Menu opens

* Jest tests
2023-07-26 21:06:46 -02:30
David Walsh
41bab4a6e1 UX: Show Checksum Addresses in Account Menu 2023-07-26 17:42:54 -02:30
David Walsh
f14a0ddb94 UX: Ensure block explorer link is for desired account (#20144) 2023-07-26 17:42:47 -02:30
David Walsh
78a0587c97 Fix #20006 - Add Address Details and View on Explorer to Global Menu (#20013)
* Fix #20006 - Add Address Details and View on Explorer to Global Menu

* Fix tests
2023-07-26 17:42:34 -02:30
Harsh Shukla
1277c6225d
Part of #18714 in ui\components\app\custom-spending-cap (#20039)
* Part of #18714 in ui\components\app\custom-spending-cap

* Update checkbox.test.tsx.snap
2023-07-17 22:03:46 -07:00
George Marshall
36be38e979
Update Text import paths: /multichain (#20061)
* Updating import paths for Text component

* Updating snapshots

* Adding story for TokenCell

* Updating banner in account details

* Fixing lint issue by removing unused import
2023-07-17 22:02:02 -07:00
David Walsh
3f3ee63b17
UX: Make 'Done' button a block in Account Details (#20059) 2023-07-17 21:37:29 -05:00
George Marshall
5d17f86e02
Update Text import paths: component library/ (#19987)
* Updating component-librar import paths

* Updating snapshots

* Updates to AvatarBase story

* Updates to avatar and checkbox

* Updating last of the deprecated import paths

* Updating component-library snapshots from button-base

* Updating snapshots from rest of codebase to do with button-base

* Removing unneeded CSS

* Updating snapshots
2023-07-17 14:00:16 -07:00
David Walsh
343cde9091
UX: Avoid Popover Footer when No Connected Sites (#20036)
Co-authored-by: Nidhi Kumari <nidhi.kumari@consensys.net>
2023-07-17 13:12:45 -05:00
vthomas13
4dcde1e216
Multichain Activity Screen (#19557)
* layout wip

* Icon changes, add badgewrapped icons to smart tx

* grouping by date wip

* typo fix

* group txs by date, button styling

* removing queue/history division, adding datestamp for pending tx, minor styling changes

* adding tests, updating snap

* font size fix

* e2e fixes

* Remove unnecessary tabIndex and keypress handler

* Fix typo for fontWeight

* Fix nesting warning by removing unnecessary Text

* Fix tests

* Fix import and exports

* Remove unused verbiage

* Update E2E selectors

* More E2E

* More E2Es

* More test fixes

* awaiting find instead of click

* adding regularDelayMs to flaky test

* removing delay

* increasing delay outside of wait

* adding back first-child to selector

* test fixes

* using datatestid for primary currency

* sorting date txgroups

* wip alignment for big numbers

* alignment issues fix

* lintfix

* adding tabindex, cursor pointer, updating snap

* unit test fix

* storybook additions

* snaphot update

* update snap

---------

Co-authored-by: David Walsh <davidwalsh83@gmail.com>
2023-07-17 13:48:15 -04:00
Albert Olivé
ea589a6e5c
[MMI] Update Modals (#20054) 2023-07-17 19:34:32 +02:00
Nidhi Kumari
8e361b391a
UX Multichain: Added background color of test networks (#20032)
* added background color to token list item

* updated badge color for nft-item

* updated nft-item tests
2023-07-17 22:13:26 +05:30
Nidhi Kumari
ce771bee66
Direct users to testnet toggle on dapp requests (#20048)
* auto switch test network when dapp requests

* fixed memory leakage issue
2023-07-17 22:12:58 +05:30
Nidhi Kumari
bdbaa03aca
UX: Updated nfts detection notice to use Banner (#20053)
* updated nfts detection notice to use banner

* removed unused css file

* updated global css file
2023-07-17 21:28:36 +05:30
Albert Olivé
0309858917
[MMI] Fixed remove custodian token (#20021) 2023-07-17 12:11:38 +02:00
George Marshall
805cc31e63
Updating BadgeWrapper to use TS Box (#19769) 2023-07-14 13:05:00 -07:00
Garrett Bear
c028bba8fd
Update ButtonLink hover underline (#19992)
* Update ButtonLink hover underline

* update buttonlink to use text decoration

* update buttonlink to use text decoration

* fix lint
2023-07-14 12:25:46 -07:00
Garrett Bear
775ca0dc31
Feat/15438/create ds checkbox component (#19808)
* add ds checkbox

---------

Co-authored-by: Garrett Bear <gwhisten@gmail.com>

---------

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2023-07-14 11:50:47 -07:00
Daniel
1295474dc3
Show a balance for the Token To, update position of the MM fee, removes a link (#20030) 2023-07-14 20:48:46 +02:00
George Marshall
74cc312cb1
Updating Text and import paths (#19949) 2023-07-14 10:59:30 -07:00
Nidhi Kumari
5bc0ba7f3a
Move "Import NFTs" to Modal (#19806)
* moved import nft to modal

* fixed modal state

* updated port-nft-popup

* updated onChange for import nft modal

* updated tests

* updated tests

* updated tests

* added story and updated spec file

* updated spec file

* updated spec file

* updated spec file for import-nft

* added focus to form field

* added autofocus to tokenId
2023-07-14 21:48:41 +05:30
Nidhi Kumari
7bdd76a4ad
updated hardware wallet text (#20026) 2023-07-14 21:12:01 +05:30
David Walsh
45b7b0ca76
UX: Network Menu: Disable testnet toggle when on testnet (#19951) 2023-07-14 08:21:53 -05:00
David Walsh
6c04d76502 Fix #19941 - Correctly show network name and selection when chainIds collide (#19947) 2023-07-14 05:54:02 -02:30
Nidhi Kumari
710101991c fixed button in wallet-overview (#19920)
* fixed button in wallet-overview

* lint fix

* updated selector css with class
2023-07-14 05:54:02 -02:30
Howard Braham
3ef2faf41c
fix(clipboard): Increase DEFAULT copy to clipboard time (#20008) 2023-07-13 13:49:13 -07:00
Ariella Vu
0917b7c52f
Add alternative summary UI with arrow icon to the Disclosure component (#19770)
* disclosure: add isArrowSummary option w/ UI

* disclosure.scss: add missing trailing semicolon

* Disclosure: replace isArrowSummary -> type prop

* Disclosure: alphabetize props

* Disclosure: add cursor: pointer

* storybook: add Disclosure - Type Arrow

* Disclosure: margin-left: 0 arrow type content

* Disclosure: fix margin-left: 0 arrow type

* Disclosure: support Text media query for Arrow

* Disclosure: clean rn type -> variant

* Disclosure: use size prop for arrow summary text

* Disclosure: update rest of type -> variant

* Disclosure: 1 more type -> variant

* Disclosure: TypeArrow -> VariantArrow
2023-07-13 22:38:42 +02:00
Garrett Bear
090476d9a2
ButtonIcon background & ButtonBase disabled update (#19976)
* button background hover updates

* add buttonlink underline

* update button base disabled

* fix size auto

* Update ui/components/component-library/button-link/button-link.stories.js

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

* remove underline

---------

Co-authored-by: George Marshall <george.marshall@consensys.net>
2023-07-13 13:22:40 -07:00
David Walsh
719d8a499b
Fix #19941 - Correctly show network name and selection when chainIds collide (#19947) 2023-07-13 13:29:53 -05:00
Nidhi Kumari
f17a841677
fixed button in wallet-overview (#19920)
* fixed button in wallet-overview

* lint fix

* updated selector css with class
2023-07-13 15:31:10 -02:30
David Walsh
0ba409662e
UX: Remove Portfolio from Token Overview Page (#19988)
Co-authored-by: Nidhi Kumari <nidhi.kumari@consensys.net>
2023-07-13 12:52:27 -05:00
David Walsh
fac889c111 Fix #19548 - Increase address copy to clipboard time (#19948) 2023-07-13 15:11:27 -02:30
Dan J Miller
f145331665 Fix memory based performance problem caused by use of lodash memoize in box component (#19993) 2023-07-13 15:03:01 -02:30
Dan J Miller
5529c5963e Merge branch 'master' into Version-v10.34.0 2023-07-13 14:05:19 -02:30
Albert Olivé
47fe542273
[MMI] Review interactive replacement token flow (#19974)
* Sending showCustodyConfirmLink as a prop and fixing other issues

* Upgraded MMI extension monrepo and trying to fix the issue

* prevents deeplink from closing

* Fixed styles of Custody view and changed the place of it

* Fixed CI issues

* fixing eslint issues

* Update LavaMoat policies

* fixing tests

* Fixed test

* updated snapshots

* Improving IRT flow

* Fixing everything

* Finish fixing all issues

* Fixed institutional entity done page styles

* Fixing boxes

* Fixed issue with checkbox

* Fixed tests and styles

* Removed duplicated lodash

* updated snapshot

* Fixing tests

* Removed unused test

* Fixed snapshot

* Fixed snapshot

---------

Co-authored-by: Antonio Regadas <antonio.regadas@consensys.net>
Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
2023-07-13 18:27:49 +02:00