* Omit MetaMask `extensionId` from site metadata
The site metadata was updated in #7218 to include the extension id of
the extension connecting to MetaMask. This was done to allow external
extensions to connect with MetaMask, so that we could show the id on
the provider approval screen.
Unbeknownst to me at the time, the extension id was being set for all
connections to MetaMask from dapps. The id was set to MetaMask's id,
because the connections are made through MetaMask's contentscript.
This has been updated to only set the id when accepting a connection
from a different extension.
* Fix `siteMetadata` property names
In #7218 a few things were added to the site metadata, so the provider
approval controller was middleware was updated to accept the site
metadata as an object rather than accepting each property as a separate
parameter. Unfortunately we failed to notice that the site name and
icon were named differently in the site metadata than they were in the
provider approval controller, so the names of those properties were
unintentionally changed in the controller state.
The provider approval controller has been updated to restore the
original property names of `siteTitle` and `siteIcon`. An unused prop
that was added to the provider approval page in #7218 has also been
removed.
On the signature request and transaction confirmation notification
pages, the closure of the notification UI implies that the request has
been rejected. However, this rejection is being submitted even when the
window is closed as a result of the user explicitly confirming or
rejecting. In practice, I suspect this has no effect because the
transaction, after being explicitly confirmed or rejected, has already
been moved out of a pending state. But just in case there is some
present or future edge case that might be affected, the `beforeunload`
handler is now removed once the user has explicitly made a choice.
This mistake was introduced recently in #7333
* Adds Wyre widget to the deposit modal.
* Move wyre widget code to vendor directory
* Get Wyre widget working without metamask connect/sign steps
* Code cleanup for wyre changes
* Change wyre widget to using prod environment
* Remove code allowing signing of wyre messages without confirmations
* Update wyre vendor code for wyre 2.0
* Remove unnecessary changes to provider approval constructor, triggerUI and openPopup
* Fix Wyre translation message
* Delete no longer used signature-request-modal
* Fix documentation of matches function in utils/util.js
* Code cleanup on wyre branch
* Remove front end code changes not needed to support wyre v2
* Refactoring signature-request out to a new component. Wip
* Styling polish and a better message display.
* Update signature request header to no longer use account dropdown mini
* Clean up code and styles
* Code cleanup for signature request redesign branch
* Fix signature request design for full screen
* Replace makenode with object.entries in signature-request-message.component.js
* Remove unused accounts prop from signature-request.component.js
* Use beforeunload instead of window.onbeforeunload in signature-request
* ENS Reverse Resolution support
* Save punycode for ENS domains with Unicode characters
* Update SenderToRecipient recipientEns tooltip
* Use cached results when reverse-resolving ENS names
* Display ENS names in tx activity log
* Add estimated time to pending transactions
* add sytles for pending transactions component
* add media queries styling for pending transactions component
* fix lint errors, remove extra spaces
* refactor code to call `fetchBasicGasAndTimeEstimates` method once
* refactor code to call `getgetRenderableTimeEstimate` method once
* fix, correct export to use `transaction-time-remaining-component`
* fix indentation issues after running `yarn lint`
* newBigSigDig in gas-price-chart.utils supports strings
* Code cleanup
* Ensure fetchBasicGasAndTimeEstimates is only called from tx-list if there are pending-txs
* Move gas time estimate utilities into utility file
* Move getTxParams to transaction selector file
* Add feature flag for display of remaining transaction time in tx history list
* Fix circular dependency by removing unused import of transactionSelector in selectors.js
* Use correct feature flag property name transactionTime
* Ensure that tx list component correctly responds to turning tx time feature on
* Prevent precision errors in newBigSigDig
* Code clean up for pending transaction times
* Update transaction-time-remaining feature to count down seconds, countdown seconds and show '< 30'
* Code clean up for transaction-time-remaining feature
* Cleanup beforeunload handler after transaction is resolved
The notification window was updated to reject transactions upon close
in #6340. A handler that rejects the transaction was added to
`window.onbeforeunload`, and it was cleared in `actions.js` if it was
confirmed or rejected.
However, the `onbeforeunload` handler remained uncleared if the
transaction was resolved in another window. This results in the
transaction being rejected when the notification window closes, even
long after the transaction is submitted and confirmed. This has been
the cause of many problems with the Firefox e2e tests.
Instead the `onbeforeunload` handler is cleared in the
`componentWillUnmount` lifecycle function, alongside where it's set in
the first place. This ensures that it's correctly unset regardless
of how the transaction was resolved, and it better matches user
expectations.
* Fix indentation and remove redundant export
The `run-all.sh` Bash script now uses consistent indentation, and is
consistent about only re-exporting the Ganache arguments when they
change.
* Ensure transactions are completed before checking balance
Various intermittent e2e test failures appear to be caused by React
re-rendering the transaction list during the test, as the transaction
goes from pending to confirmed. To avoid this race condition, the
transaction is now explicitly looked for in the confirmed transaction
list in each of the tests using this pattern.
* Enable all e2e tests on Firefox
The remaining tests that were disabled on Firefox now work correctly.
Only a few timing adjustments were needed.
* Update Firefox used in CI
Firefox v70 is now used on CI instead of v68. This necessitated
rewriting the function where the extension ID was obtained because the
Firefox extensions page was redesigned.
`ethereumjs-util` is now pinned at `5.1.0`, instead of at the commit
`ac5d0908536b447083ea422b435da27f26615de9`. That commit immediately
preceded v5.1.0, so there are no functional differences. This was
done mainly to remove our last GitHub/git dependency, and to make it
more obvious which version we're using.
* tests - create tests for pending middlewares
* transactions - add r,s,v values to the txMeta to match the JSON rpc response
* network - add new middleware for eth_getTransactionByHash that the checks pending tx's for a response value
* transactions/pending - use getTransactionReceipt for checking if tx is in a block
* meta - file rename
The class has been renamed to reflect that it is a header, to avoid
having the same name as the `ConfirmPageContainer` component. Multiple
components with the same name can lead to confusing error messages.
If the extension ID is set, an alternate title and subtitle are used
for the Connect Request screen. The title is always `External
Extension`, and the subtitle is `Extension ID: [id]` instead of the
origin (which would just be `[extension-scheme]://[id]` anyway).
The hostname for the site is used as a fallback in case it has no
title.
The artificial hostname set for internal connections has been renamed
from 'MetaMask' to 'metamask' because URL objects automatically
normalize hostnames to be all lower-case, and it was more convenient to
use a URL object so that the parameter would be the same type as used
for an untrusted connection.
* Start refactor
* Use import syntax
* Add create-account.component
* Continue refactor
* Add new line
* Start using JSX and make tabs a bit more DRY
* 👋 bye-bye hyperscript
* These can be disabled when active
* Start JSX in new account component
* 👋 bye-bye hyperscript
* Move newAccountNumber into container
* Validate newAccountNumber prop
* Begin mocking out retry ui
* Remove "Failed"
* I guess this works?
* Update corresponding test
* wip
* Ok, this appears to be working now
* cleanup
* Move this back to 3
* I don't think I need this
* Rename showRetry to showSpeedUp
* Address PR feedback
* Remove notes
* Rename shouldShowRetry -> shouldShowSpeedUp
* oops
* Add a delay after connecting
This addresses an intermittent test failure where the MetaMask
Notification window cannot be found. It appears to be caused by the
Send button being clicked too soon after connecting to a dapp, before
the background has had a chance to process the approval. The premature
send is ignored and the window never appears.
This delay (2 seconds) should be sufficient time for the connection to
be processed. A later 5-second delay was also reduced to 2 seconds.
* Select onboarding buttons by button text
The onboarding buttons were being selected using the classname, which
was common to all onboarding buttons. This resulting in buttons being
selected just before a page transition, leading to an error about
the element reference being stale when a click was attempted.
The CSS class selectors have been replaced by text selectors, which
are more specific and shouldn't be at risk of resolving early. They're
also easier to read.
* Remove retypeSeedPhrase function
This function was used to re-type the seed phrase in the event that a
failure occurred when confirming the seed phrase. I'm not sure what
failure this was meant to address exactly, but this contingency hasn't
been needed for some time. We can tell that it hasn't been used because
it wasn't updated for the incremental account security changes, so it
couldn't have worked since then (it would have clicked the wrong
button).
* Use `AdvancedGasInputs` in `AdvancedTabContent`
The `AdvancedGasInputs` component was originally extracted from the
`AdvancedTabContent` component, duplicating much of the rendering
logic. They have since evolved separately, with bugs being fixed in one
place but not the other.
The inputs and outputs expected weren't exactly the same, as the
`AdvancedGasInputs` component converts the input custom gas price and
limit, and it converts them both in the setter methods as well.
The `GasModalPageContainer` had to be adjusted to avoid converting
these values multiple times.
Both components dealt with input debouncing separately, both in less
than ideal ways. `AdvancedTabContent` didn't debounce either field, but
it did debounce the check for whether the gas limit field was below the
minimum value. So if a less-than-minimum value was set, it would be
propogated upwards and could be saved if the user clicked 'Save'
quickly enough. After a second delay it would snap back to the minimum
value. The `AdvancedGasInputs` component debounced both fields, but
it would replace any gas limit below the minimum with the minimum
value. This led to a problem where a brief pause during typing would
reset the field to 21000.
The `AdvancedGasInputs` approach was chosen, except that it was
updated to no longer change the gas limit if it was below the minimum.
Instead it displays an error. Parent components were checked to ensure
they would detect the error case of the gas limit being set too low,
and prevent the form submission in those cases. Of the three parents,
one had already dealt with it correctly, one needed to convert the
gas limit from hex first, and another needed the gas limit check added.
Closes#6872
* Cleanup send components
Empty README files have been removed, and a mistake in the index file
for the send page has been corrected. The Gas Slider component class
name was updated as well; it looks like it was originally created from
`AdvancedTabContent`, so it still had that class name.
Security advisory: https://www.npmjs.com/advisories/1184
This advisory was already addressed in #7289 but subsequent releases
have made this simpler resolution possible.
This simplifies the logic of signing and improves security:
- Private keys are never moved to the base controller.
- Hardware wallets are abstracted in the same way as local keys.
This also paves the way for allowing even more modular accounts,
provided by plugins:
https://github.com/MetaMask/metamask-plugin-beta/pull/63Fixes#7075.