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

11201 Commits

Author SHA1 Message Date
Whymarrh Whitby
3c492a2ff7
Remove incorrect Migrator comment (#9659)
This change removes an incorrect comment about migrations
2020-10-20 11:34:55 -02:30
Mark Stacey
a9a432db0c
Fix conversionRate PropType of GasModalPageContainer (#9651)
The `conversionRate` prop of `GasModalPageContainer` was updated
recently in PR #9623 to have a PropType of `string` instead of
`number`. This resulted in a PropType error whenever this modal was
rendered, as `conversionRate` is always a `number`.

The PropType has been reverted to the correct type, `number`.
2020-10-20 10:37:14 -02:30
Mark Stacey
4197ff7295
Fix contentText PropType of InfoTooltip (#9652)
The `InfoTooltip` component had a `contentText` prop with a PropType of
`string` that was being passed a `node` as of #9614. This resulted in a
PropType error.

The `contentText` prop was being passed directly to `Tooltip` component
as the prop `html`, which has a PropType of `node`. A string is a valid
`node` type, which is why this worked before.

The `contentText` prop is now of type `node`, and the error no longer
appears.
2020-10-20 10:36:57 -02:30
Mark Stacey
7f1bbbc9a3
Fix message PropType of ActionableMessage (#9653)
The `message` prop of `ActionableMessage` had a PropType of `string`,
but it was being passed a `node`. This was resulting in a PropType
error in the console on the view quote page.

The PropType has been changed to `node`, and the error is now gone.
2020-10-20 10:36:44 -02:30
Mark Stacey
d43738448c
Fix React warning about missing key in AwaitingSwap (#9655)
The `AwaitingSwap` component was emitting a React warning when rendered
because a component was being rendered in an array without having a
`key` prop set.

A key has been added to the `CountdownTimer` component, which is passed
into the translation helper in an array. The warning no longer appears.
2020-10-20 10:36:15 -02:30
Mark Stacey
f4838194d6
Remove unused customGasLimit parameter (#9656)
This parameter to the `quotesToRenderableData` function was never
passed in. It has been removed.
2020-10-20 10:36:00 -02:30
Mark Stacey
97450cd8fd
Remove non-existent metaMaskFee property (#9657)
The `metaMaskFee` property on the "quote data" PropType was not used,
and it never existed in practice. This resulted in PropType errors.

The non-existent property has been removed.
2020-10-20 10:35:34 -02:30
Ari Lotter
c3fafe311e
Spawn yarn processes in a cmd subshell on Windows (#9628)
On Windows, spawn fails if the exact filename
of a binary isn't passed. e.g. `spawn('yarn')` fails
because the binary is named `yarn.cmd`.
Instead, we depend on `cross-spawn` which handles differences
in `spawn` across platforms.
2020-10-20 01:37:23 -02:30
Erik Marks
edefdc4ede
Fix estimated network fee line split (#9648) 2020-10-19 20:59:31 -02:30
Mark Stacey
4cab30eae1
Remove duplicate percent sign from MetaMask fee (#9647)
The MetaMask fee is shown with two percent signs on the view quote page, because the percent sign is embedded in the fee amount as well as in the localized message.

The fee amount used now comes from the API, and does not have a percent sign. The percent sign is now only in the localized message. This allows for different locales to display the percentage differently. The old hard-coded value with a percent sign embedded has been removed, as it is no longer used anywhere.
2020-10-19 20:58:48 -02:30
Erik Marks
7de7e7d8c2
Add swaps savings calculation (#9611)
* Calculate savings per swap relative to median values

* Update test mock quotes, add getMedian tests

* Identify assets by sourceToken and destinationToken
2020-10-19 14:52:47 -07:00
Dan J Miller
43d97ebe4f
getStatusKey to return an empty string when passed a falsy value (#9640) 2020-10-19 18:29:48 -02:30
Dan J Miller
c8526bc687
Update view-quote designs to better represent the metamask fee (#9633)
* Update view-quote designs to better represent the metamask fee

* Code clean up

* Copy updates
2020-10-19 17:15:32 -02:30
Dan J Miller
d44c03b882
Cast MIN_GAS_LIMIT_DEC to number before passing to minimumGasLimit (#9636) 2020-10-19 15:21:36 -02:30
Dan J Miller
b1adc0d1e8
Fix use transaction time remaining (#9630)
* Only format timeRemaining if in useTransactionTimeRemaining if it is truthy

* Only setTimeRemaining in useTransactionTimeRemaining if submitted time is a number

* Use isSubmitted as a check, instead of isPending and submittedTime, before calculating timeRemaining
2020-10-19 12:15:21 -02:30
Dan J Miller
7925a767b8
Add a minimumGasLimit to the original gas customization modal (#9623)
* Add a minimumGasLimit to the gas customization modal in swaps

* Update app/_locales/en/messages.json

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

* Set default for minimum gas limit in gas-modal-page-container.container and make required in sub components

* Update unit tests

* Default value for minimumGasLimit in advanced-gas-inputs.component.js

* Preserve existing gasLimitTooLow message key by creating new gasLimitTooLowWithDynamicFee

* Fix failing unit test

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: Erik Marks <rekmarks@protonmail.com>
2020-10-19 10:41:23 -02:30
Dan J Miller
397e3a2c7f
Update swaps network fee tooltip (#9614)
* Update network fee tooltip in fee-card to match latest designs

* Clean up css classes and div
2020-10-19 05:54:59 -02:30
Dan J Miller
3191d9e014
Help users avoid insufficient gas prices in swaps (#9624)
* Don't show average (slowest) button in custom gas modal while in swaps

* In swaps, show warning in custom gas modal if price set below average price

* Update ui/app/selectors/custom-gas.js

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>

* Fix typo

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2020-10-17 06:43:51 -02:30
Dan J Miller
e546314e3f
Update fee card storybook to utilize latest fee-card api (#9613)
* Update fee card storybook to utilize latest fee-card api

* Update ui/app/pages/swaps/fee-card/fee-card.stories.js

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-10-16 13:29:32 -02:30
David Walsh
0a874e2a87
Merge pull request #9616 from darkwing/prevent-button-warning
Fix #9577 - Use contained button type for unlock button
2020-10-16 09:15:20 -05:00
David Walsh
b1f7fbf343
Merge pull request #9608 from darkwing/9043-camera
Fix #9043 - Ensure QR code scanner works
2020-10-16 09:15:00 -05:00
Mark Stacey
003f1306d3
Split the account tracker doc comments (#9574)
The account tracker had one doc comment above the constructor that
partially served to document the constructor, but mostly contained a
type definition for the class itself. It has been split into two
blocks; one for the class, one for the constructor. The constructor doc
comment has also been expanded to document all constructor options.
2020-10-15 13:09:13 -02:30
David Walsh
971f5b0056 Fix #9577 - Use contained button type for unlock button 2020-10-15 10:36:15 -05:00
Mark Stacey
a53121a763
Use chainId in account tracker (#9573)
The `chainId` is now used by the account tracker to identify the
current network, instead of the `networkId`. This should have no
functional impact, aside from that different chains with the same
`networkId` will now be correctly distinguished from each other.
2020-10-15 11:18:30 -02:30
Mark Stacey
98e8f6675f
Merge pull request #9615 from MetaMask/sync-master
Sync `master` with `develop`
2020-10-15 11:17:53 -02:30
Mark Stacey
ffd3de0ec9
Merge pull request #9589 from MetaMask/Version-v8.1.1
Version v8.1.1 RC
2020-10-15 10:44:41 -02:30
Mark Stacey
4496a273f1
Update v8.1.1 changelog (#9610)
PR #9609 has been added to the changelog for v8.1.1
2020-10-14 22:15:26 -02:30
Whymarrh Whitby
c44b2ca00f Update changelog for 8.1.1 (#9605)
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-10-14 21:51:22 -02:30
MetaMask Bot
bb854e17f8 Version v8.1.1 2020-10-14 21:51:22 -02:30
Dan J Miller
af018a2d74
Clear all gas slice state on entering and leaving swaps (#9609) 2020-10-14 21:50:37 -02:30
David Walsh
9987484301 Fix lint 2020-10-14 17:07:15 -05:00
David Walsh
15654b3d0b Prevent unnecessary teardown 2020-10-14 17:05:36 -05:00
David Walsh
947bfb7a11 Fix #9043 - Ensure QR code scanner works 2020-10-14 17:00:40 -05:00
Brad Decker
83fe472779
fix issue with unmatched routes (#9595)
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2020-10-14 14:23:38 -05:00
Dan J Miller
0558689636
Compare convert ethBalance to decimal before comparing to fromTokenBalance in useEffect for eth token balance update (#9607) 2020-10-14 16:48:21 -02:30
Erik Marks
c39617e111
Make FeeCard component specific to swaps (#9603)
* Make FeeCard component specific to swaps

* Fix some prop types
2020-10-14 11:59:03 -07:00
Erik Marks
a0d7aa56aa Loosen isBestQuote PropType 2020-10-14 10:17:41 -07:00
Erik Marks
799df99bd0 Rename some props 2020-10-14 10:12:35 -07:00
Erik Marks
b31816d6f7 Make FeeCard component specific to swaps 2020-10-14 10:06:17 -07:00
David Walsh
ec70f33eca
Try disable swap button so it cannot be focused (#9602) 2020-10-14 14:16:14 -02:30
David Walsh
d0152aad51
Use localizations for placeholders in Swap (#9587) 2020-10-14 14:15:44 -02:30
David Walsh
48dd3fe069
AutoFocus the from input on swaps screen (#9581) 2020-10-14 14:13:55 -02:30
David Walsh
bbd4ee5fdf
Autofocus the appropriate text fields in the Create/Import/Hardware screen (#9576) 2020-10-14 14:13:26 -02:30
David Walsh
674107da3f
Ensure proper hover display for accounts in main menu (#9575) 2020-10-14 14:13:09 -02:30
Dan J Miller
2563180a88
Data consistency swaps token balance (#9588)
* Explicitly set balance and string on the swaps from token in token-overview

* Set swapsFromToken balance to a decimal instead of a hex on eth balance change in build-quote
2020-10-14 14:09:04 -02:30
Erik Marks
4149fed6e0
Update text content of invalid custom network (#9601) 2020-10-14 09:38:12 -07:00
Mark Stacey
360d8ded1f
Fix exception upon failure to get next nonce (#9598)
An attempt to safely release the `nonceLock` upon failure has instead
made failure worse by masking it with a new error. If the call to get
the `nonceLock` throws an exception, then the `finally` block here
would attempt to call `releaseLock` on the `nonceLock` variable, which
is guaranteed to be `undefined` if the previous call failed. The
attempt to call a method on `undefined` throws another error, masking
the original error.

It is safer to obtain the `nonceLock` and release it without using any
`try` or `finally` block. The `nonceLock` is synchronously released
immediately after it is obtained, and any errors bubble up correctly
without being masked. There is no case where the lock is left
unreleased.
2020-10-14 13:34:08 -02:30
Mark Stacey
e53f970458
Use localized strings for MetaMetrics opt-in page (#9593)
The MetaMetrics opt-in page during onboarding now uses localized
strings. This allows us to add translations.
2020-10-14 13:33:34 -02:30
Mark Stacey
aae176537f
Update Sentry to the latest version. (#9597)
All three of our Sentry packages have been updated to the latest
versions. There appear to have been no breaking changes - just bug
fixes and new features.
2020-10-14 13:30:28 -02:30
Thomas Huang
38a0c5ec75
Fix FF overflow list-item right-content/primaryCurrency wrapper (#9591)
Over flow .list-item__right-content rather than the text.
2020-10-13 21:45:21 -07:00