1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 03:36:18 +02:00
Commit Graph

2555 Commits

Author SHA1 Message Date
Whymarrh Whitby
8b308884b7
Simplify NetworkController re-export (#8528) 2020-05-05 21:02:44 -02:30
Whymarrh Whitby
ceb5970afd
Remove unused NotificationManager#closePopup (#8530) 2020-05-05 21:02:29 -02:30
Mark Stacey
3d0ffc50f8
Minimize inactive timer resets (#8531)
The inactive timer was being reset upon any change to the preferences
store. The intent was only to update the timer when the auto-lock
timeout had changed, so the subscription was updated to only update in
those cases.

There are no indications that this had any effect upon the user. It
looks like the preferences store never updates while the extension is
unattended, so in practice this may have been harmless. It was still
pointless however. This also protects against the possibility of the
preferences store being updated while unattended at some point in the
future.
2020-05-05 20:30:50 -03:00
Whymarrh Whitby
18b00ed835
Update TransactionController README (#8526) 2020-05-05 20:28:45 -02:30
Whymarrh Whitby
6b5bbe50ee
Delete createDnodeRemoteGetter.js (#8523) 2020-05-05 20:10:07 -02:30
Whymarrh Whitby
f5a125fe61
Move export defaults statements alongside their objects (#8525) 2020-05-05 19:49:38 -02:30
Whymarrh Whitby
de127b86eb
Remove unused ExtensionPlatform#closeWindow fn (#8522) 2020-05-05 19:22:14 -02:30
Whymarrh Whitby
664cac0bd5
Delete window.js (#8521) 2020-05-05 19:11:16 -02:30
Whymarrh Whitby
aac16b7134
Delete sw.js (#8520) 2020-05-05 19:10:56 -02:30
Whymarrh Whitby
ecd36a4ec1
Delete controllers/ README.md file (#8519) 2020-05-05 18:48:52 -02:30
Whymarrh Whitby
c7f866c06f
Add no-tabs ESLint rule (#8518) 2020-05-05 18:35:12 -02:30
Erik Marks
79d9209473
Open notification UI when eth_requestAccounts waits for unlock (#8508) 2020-05-05 07:03:21 -07:00
Dan J Miller
fda4c94670
Design improvements for the Connect flow (#8494)
* Design improvements for the Connect flow

* Make new-account-modal close a button

* Update e2e tests for auto select account on connect flow
2020-05-04 18:10:09 -02:30
Erik Marks
5b06bf795b
Delete amountConversionRate and selectors (#8503) 2020-05-04 10:54:54 -07:00
Erik Marks
786e82791e
Reorganize selectors directory (#8497) 2020-05-02 12:41:17 -07:00
Whymarrh Whitby
85453a2588
Rework pending tx logic (#8398) 2020-05-01 15:19:29 -02:30
Mark Stacey
5b5b67a985
Fix default gas race condition (#8490)
A race condition exists where after adding an unapproved transaction,
it could be mutated and then replaced when the default gas parameters
are set. This happens because the transaction is added to state and
broadcast before the default gas parameters are set, because
calculating the default gas parameters to use takes some time.
Once they've been calculated, the false assumption was made that the
transaction hadn't changed.

The method responsible for setting the default gas now retrieves an
up-to-date copy of `txMeta`, and conditionally sets the defaults only
if they haven't yet been set.

This race condition was introduced in #2962, though that PR also added
a loading screen that avoided this issue by preventing the user from
interacting with the transaction until after the gas had been
estimated. Unfortunately this loading screen was not carried forward to
the new UI.
2020-05-01 12:25:45 -03:00
Mark Stacey
165666b315
Remove unnecessary tx meta properties (#8489)
* Remove `estimatedGas` property from `txMeta`

The `estimatedGas` property was a cache of the gas value estimated for
a transaction when the default gas limit was set. This property wasn't
used anywhere. It may have been useful for debugging purposes, but the
same gas estimate is already stored on the `history` property so it
should be present in state logs regardless.

* Remove `gasLimitSpecified` txMeta property

The `gasLimitSpecified` property of `txMeta` wasn't used for anything.
It might have been useful for debugging purposes, but whether or not
the gas limit was specified can also be determined from looking at the
transaction history, so it's not a huge loss.

* Remove `gasPriceSpecified` txMeta property

The `gasPriceSpecified` property of `txMeta` wasn't used for anything.
It might have been useful for debugging purposes, but whether or not
the gas price was specified can also be determined from looking at the
transaction history, so it's not a huge loss.

* Remove `simpleSend` txMeta property

The `simpleSend` property of `txMeta` was used to ensure a buffer was
not added to the gas limit during gas estimation for simple send
transactions. It was made redundant by #8484, which accomplishes this
without the use of this property.
2020-05-01 08:44:05 -03:00
Mark Stacey
92592fc905
Ensure tx has value before it's added (#8486)
Previously a transaction would get assigned a default value during the
`addTxGasDefaults` function, after the transaction was added and sent
to the UI.

Instead the transaction is assigned a default value before it gets
added. This flow is simpler to follow, and it avoids the race condition
where the transaction is assigned a value from the UI before this
default is set. In that situation, the UI-assigned value would be
overridden, which is obviously not desired.
2020-04-30 21:50:44 -03:00
Mark Stacey
c2b588975c
Refactor analyzeGasUsage to return results (#8487)
`analyzeGasUsage` now returns the results of the analysis rather than
setting them directly on `txMeta`. The caller is now responsible for
mutating `txMeta` instead. Functionally this should be identical to
before.
2020-04-30 21:44:51 -03:00
Mark Stacey
157cc98c3a
Refactor gas limit estimation when gas limit specified (#8485)
The `analyzeGasUsage` function is skipped entirely now when the gas
limit is specified. This is functionally equivalent to how it worked
before.
2020-04-30 20:53:35 -03:00
Mark Stacey
afa2ff65b7
Refactor simple send gas estimation (#8484)
The simple send gas estimation has been moved out of the gas estimation
module, and into the transaction controller. This was done in an effort
to limit the number of places where `txMeta` is mutated while the
default gas parameters are being set.
2020-04-30 19:50:12 -03:00
Brad Decker
0c7269f599
fixes firefox popup location (#8467)
Co-Authored-By: Whymarrh Whitby <whymarrh.whitby@gmail.com>
2020-04-29 17:04:03 -05:00
Whymarrh Whitby
0e54c5aecd
Don't updatePendingTxs outside of block updates (#8445)
* Don't updatePendingTxs outside of block updates

Refs #8377

Reverts 507397f6c (#5431)

* Check for new block data on unlock
2020-04-29 16:01:22 -02:30
Erik Marks
c011c0406b
Add new inpage provider package (#8442)
* add @metamask/inpage-provider

* fix failing e2e tests

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-04-28 17:14:51 -07:00
Whymarrh Whitby
306f04be8d
Simplify logic in PTT helper fns (#8430) 2020-04-27 18:38:16 -02:30
Whymarrh Whitby
eb06394dd9
Delete Dai/Sai migration notification (#8418) 2020-04-27 16:23:43 -02:30
Whymarrh Whitby
7439cd1662
Mark PendingTransactionTracker#resubmitPendingTxs as async (#8399) 2020-04-27 13:24:39 -02:30
Whymarrh Whitby
b947fd54c7
Move default exports for all tx classes (#8416) 2020-04-27 12:15:00 -02:30
Whymarrh Whitby
8dd886a25b
Update tx:dropped return value in PendingTxTracker (#8397) 2020-04-26 00:03:25 -02:30
Whymarrh Whitby
d612f9988e
Move default export declaration to Migrator class (#8407) 2020-04-26 00:02:41 -02:30
Mark Stacey
bace02ad02
Remove unused ShapeShift components (#8402)
The `shift-list-item` component for displaying ShapeShift transactions
has been removed, along with three other components that were used
solely by that component (`copyButton`, `eth-balance`, and
`fiat-value`).

This component hasn't been used in some time, as ShapeShift
transactions no longer exist to display. The controller that ShapeShift
transactions originated from was removed in #8118, and it became
impossible to create new ShapeShift transactions from within MetaMask
in #6746
2020-04-24 12:33:24 -03:00
Mark Stacey
a36e6d414b
Remove unused currentAccountTab state (#8404)
This state has been removed from the background. It was used for the
old UI, and has been unused for some time. A migration has been added
to delete this state as well.

The action creator responsible for updating this state has been removed
from the UI as well, along with the `callBackgroundThenUpdateNoSpinner`
convenience function, which was only used for this action.
2020-04-24 00:23:28 -03:00
Mark Stacey
26dcb3af9b
Fix comment on migration #42 (#8405)
The comment was accidentally copied from the previous migration.
2020-04-23 23:08:50 -03:00
Mark Stacey
cc41dee92c
Remove leftover references to Coinbase (#8403)
Coinbase was removed as a deposit option some time ago.
2020-04-23 20:32:15 -03:00
Mark Stacey
24a8689090
Remove unused addNewKeyring action (#8400)
Keyrings are added either through the `getKeyringForDevice` background
method (as part of the hardware wallet connect flow), or via
`importAccountWithStrategy` (when importing an account). The
`addNewKeyring` action and corresponding background method has not been
used in a long time.
2020-04-23 20:31:59 -03:00
Whymarrh Whitby
91a75b2417
Add new PendingTransactionTracker tests (#8384)
Co-authored-by: Jenny Pollack <jennypollack3@gmail.com>
2020-04-23 13:19:04 -02:30
Whymarrh Whitby
deacde615f
Rename _checkIfTxWasDropped (#8378) 2020-04-22 17:03:59 -02:30
Dan J Miller
01985b2cff
Connected indicator info popup (#8293)
* Add popover for informing user about the connected status indicator

* Ensure user only sees connected status info popover once

* Default connectedStatusPopoverHasBeenShown to true and set it to false in a migration

* Add unit test for migration 42

* Initialize AppStateController if it does not exist in migration 42

* Update connect indicator popup locale text

* Code cleanup for connected-indicator-info-popup

* Code cleanup for connected-indicator-info-popup
2020-04-22 14:41:36 -02:30
Whymarrh Whitby
f2f70342e2
Skip adding history entry for empty txMeta diffs (#8379) 2020-04-22 11:09:16 +08:00
Whymarrh Whitby
d908102636
Update tx utils JSDoc comments (#8372)
Co-authored-by: Jenny Pollack <jennypollack3@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-04-20 16:42:24 -02:30
Whymarrh Whitby
9d535b949f
Rename recipientBlacklistChecker function (#8365) 2020-04-20 16:29:41 -02:30
Erik Marks
a2a51e78d1
Add PermissionsController.removePermittedAccount (#8354)
* add PermissionsController.removePermittedAccount and corresponding UI action

* remove eth_accounts permission on removing last account
2020-04-20 11:34:56 -07:00
Whymarrh Whitby
164923acd1
Export individual fns from tx-state-history-helpers (#8370) 2020-04-20 13:00:51 -02:30
Whymarrh Whitby
a83d26486c
Snapshot txMeta without cloning history (#8363) 2020-04-20 12:26:01 -02:30
Whymarrh Whitby
7c3ffeb841
Export blacklist direct from recipient-blacklist (#8364) 2020-04-20 12:06:02 -02:30
Brad Decker
f9989c52c5
Position notification relative to last focused window (#8356) 2020-04-19 19:30:17 -02:30
Erik Marks
5263395add
Fix background console errors on pending transaction (#8351)
* fix background console error on pending transaction
2020-04-17 09:53:46 -07:00
Mark Stacey
15616a33ca
Add 'addPermittedAccount' method to permissions controller (#8344)
This method adds the given account to the given origin's list of
exposed accounts. This method is not yet used, but it will be in
subsequent PRs (e.g. #8312)

This method has been added to the background API, and a wrapper action
creator has been written as well.
2020-04-16 19:23:36 -03:00
Erik Marks
1f49772ca3
Create new tabs instead of windows in most cases (#8347)
* openExtensionInBrowser: create tab, not window

* open tabs instead of windows in most cases
2020-04-16 14:34:40 -07:00