* fix(privateKey): Restore hold-to-reveal button for private key export
* lint and unit test fixes
* adding e2e tests to reveal private key
* fixing lint issues
* fixed: Private key is able to be presented without tapping and holding the "Hold to reveal" CTA
* Incorrect password test and support hold to reveal
* improving unit tests
---------
Co-authored-by: Plasma Corral <32695229+plasmacorral@users.noreply.github.com>
Co-authored-by: Gustavo Antunes <17601467+gantunesr@users.noreply.github.com>
* feat(878): implement new incoming transaction toggle networks for setting and onboarding
* Update state snapshots
* feat(878): change gaps, migration types based on comment
---------
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
* fix(settings): fixed two IPFS gateway issues
- adds back in two bugfixes that were originally in #19283
- fixes#16871
- fixes#18140
- achieves 100% code coverage for /ui/pages/settings/security-tab
- removes the npm package `valid-url`, which has not been updated in 10 years
* changes after #20172 was merged
* improved URL validation (specifically spaces)
* better Jest coverage
* response to legobeat review
* fixing lint and Jest
Remove the IncomingTransactionController and replace it with an internal helper class.
Move incoming transactions into the central transactions object.
Create a new RemoteTransactionSource interface to decouple incoming transaction support from Etherscan.
Split the incoming transaction logic into multiple files for easier maintenance.
* BannerBase to TS
* snapshot updates
* more snapshot updates
* addressing type definition error
* updating eth-sign-modal snapshot
* Updates to stories, types and adding data-testid
* Updating snapshots
* updating snapshot of blockaid-banner-alert and adding unit test for childrenWrapperProps
* BannerBase updates to stories, adding locale for close button, removing static data-testid in favor of using it at the instance, updating snapshots associated with those changes
* Removing incorrect arg from storybook file
* Updating html element in security provider e2e test to match BannerBase. Also updating snapshot of ConfirmTransaction page
* Fixing e2e tests
---------
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
* 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.
* fix(custodial-signing): set approved status in tx controller in MMI logic
* Fixed the issue that was not showing custody-confirm-link
---------
Co-authored-by: Shane Terence Odlum <shane.odlum@consensys.net>
* fixed connect mmi button several issues
* Fixed snapshot
* Improved multiple things
* running yarn dedupe
* Update LavaMoat policies
* For some reason, this.mmiConfigurationController.store.mmiConfiguration?.portfolio sometimes is undefined, added [] if null.
Moved the || {} outside the find method
* minor improvements
---------
Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
* 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
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.
* 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.
* refactor: use addNewAccount from core KeyringController
* refactor: replace missed interaction
* refactor: select account only when is new
* refactor: use getAccounts to check if account is new
* Replaced ActionableMessage in confirm-page-container-content
* Updated Snapshot of confirm-transaction-base
* Updated BannerAlert className
* Using component API and replacing ErrorMessage
* Update snapshot
---------
Co-authored-by: George Marshall <george.marshall@consensys.net>
* Replacing deprecated components in ConfirmationWarningModal
* Layout and semantic html updates to align with design system conventions
---------
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
* ButtonSecondary to TS
* updating components and addressing errors
* lint and snapshot updates
* using Boolean conversion for className
* removing ValidButtonTag type
* fix text color when link
---------
Co-authored-by: garrettbear <gwhisten@gmail.com>
* 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>
* Fix#20184 - Prevent overflow within the activity list
* removing inline style, updating snap
---------
Co-authored-by: Victor Thomas <10986371+vthomas13@users.noreply.github.com>
* migration of Popover to use TS Box version
* fix lint error
* Updating docs
---------
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
* Replaced ActionableMessage component in srp-input
* Modified value of Severity in srp-input/BannerAler
* fixed lint error
* Updateddata-testid in banner and test/e2e/helpers.js
* Updated className with prefix
---------
Co-authored-by: George Marshall <george.marshall@consensys.net>
* Fix#20305 - Show the network name in Delete Network modal
* Update app/_locales/en/messages.json
Co-authored-by: George Marshall <george.marshall@consensys.net>
* Add unit test
---------
Co-authored-by: George Marshall <george.marshall@consensys.net>
* feat(878): add new incomingTxn component and change styles of settings
* feat(878): relocate openSea tab from rebase regression
* feat(878): make UI and test modifications
* feat(878): transfer to ts
* feat(878): rename network-toggle.tsx
* 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
* Add link to buy more ETH if insufficient gas
* Fix lint error
* Use native currency per network
* Use localized msg for buy more gas
* Add the word "more"
* Fix smart tx not showing msg
* Pull out not enough balance into own component
* Add story for not enough balance
* Fix btn text not being aligned with rest of text
* Move inline style to class, remove empty classname
* Update ui/pages/swaps/prepare-swap-page/not-enough-balance.stories.tsx
Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
* Update ui/pages/swaps/prepare-swap-page/index.scss
Co-authored-by: Nidhi Kumari <nidhi.kumari@consensys.net>
* Remove line
* Move BannerAlert back into review-quote and use BannerAlert props
* Remove unused CSS
---------
Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
Co-authored-by: Nidhi Kumari <nidhi.kumari@consensys.net>
* migration of HeaderBase to use TS Box version
* migration of HeaderBase to use TS Box version
* update snapshot
* fix lint error
* Some small updates to types and removing deprecated storyook functions
---------
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
* Replaces SEVERITIES const with Severity enum in BannerAlert
* Replaced SEVERITIES with Severity in banner-alert.constants.js
* Used BANNER_ALERT_SEVERITIES instead of SEVERITIES in banner-alert.stories.js
* Updated README for usage of Severity instead of SEVERITIES
* Updates to stories and docs link
---------
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
* Update ModalOverlay to use TS Box version
* fix jest error
* lint error fix
* Fix lint errors and improve ModalOverlay's TypeScript typings
* Some small updates to story and docs
---------
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
* Replaced with new checkbox in ConnectedAccountsPermissions
* removed a typo
* fixed linting issue
* Small updates to styles
---------
Co-authored-by: George Marshall <george.marshall@consensys.net>
* Add story for smart tx popover
* Use tsx for smart tx popover story and add btn to open it
* Refactor smart tx popover component to tsx and style
* Fix modal not triggering
* Remove bold from bullet points
* Adjust margins