Merged
Conversation
* Calculate savings per swap relative to median values * Update test mock quotes, add getMedian tests * Identify assets by sourceToken and destinationToken
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.
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.
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.
This parameter to the `quotesToRenderableData` function was never passed in. It has been removed.
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.
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.
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.
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`.
This change removes an incorrect comment about migrations
Fix 9638 - Prevent excessive overflow from swap dropdowns
Sorting was broken for the "Quote Source" column of the quote sort list. Attempting to sort by this column would arrange the quotes in a seemingly random order. It appears that this was due to this column being programmed to sort by a property called `liquiditySource`, which does not exist in the quote data. I'm unsure what the difference between `liquiditySource` and `quoteSource` was supposed to be; the values in the mocks are all identical. All references to `liquiditySource` have been updated to refer to `quoteSource` instead, and the sorting now works correctly.
This change updates the command used to create RC pull requests to create [draft PRs][1]. [1]:https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests
Make loading screen more concise
`@metamask/eslint-config` has been updated to v4.1.0. This update requires that we update `eslint` to v7 as well, which in turn requires updating most `eslint`-related packages. Most notably, `babel-eslint` was replaced with `@babel/eslint-parser`, and `babel-eslint-plugin` was replaced by `@babel/eslint-plugin`. This required renaming all the `babel/*` rules to `@babel/*`. Most new or updated rules that resulted in lint errors have been temporarily disabled. They will be fixed and re-enabled in subsequent PRs.
Refs #9663 See [`node/no-callback-literal`][1] for more information. This change enables `node/no-callback-literal` and fixes the issues raised by the rule. [1]:https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-callback-literal.md
Consolidates the background and UI segment implementations into a shared solution. This results in the introduction of our first shared module. Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
Refs #9663 See [`node/no-path-concat`][1] for more information. This change enables `node/no-path-concat` and fixes the issues raised by the rule. [1]:https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-path-concat.md
Our ENS resolver for the browser address bar was incorrectly resolving addresses that included query strings. We were concatenating the `path` property with the `search` property, despite the fact that the `path` property already contains `search`. As a result, `search` was duplicated in the resolved addresses. For example, if an IPFS content ID was found for this address, the resolved address for `metamask.eth/?foo=bar` would have the path `/?foo=bar?foo=bar` The original intent was likely to use `pathname` in place of `path`. The resolver has been updated to use `pathname`, and the query string now appears only once in the resolved address.
Refs #9663 See [`node/no-deprecated-api`][1] for more information. This change enables `node/no-deprecated-api` and fixes the issues raised by the rule. [1]:https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-deprecated-api.md The change to the way that `punycode` is imported is to address the fact that third-party module is hidden by the built-in. This is a silly hack but it works.
* Check if swapTokenValue is negative and set prefix accordingly Co-authored-by: Mark Stacey <markjstacey@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
7c6fec6 to
6a93664
Compare
The command `mocha` was included twice in `test:unit:global` accidentally. The second occurrence was interpreted as a filename, and would result in the following warning: `Warning: Cannot find any files matching pattern "mocha"` The second instance has been removed, and the warning no longer appears.
Collaborator
Author
Builds ready [6a93664]
Page Load Metrics (592 ± 26 ms)
|
Collaborator
Author
Builds ready [4b0c344]
Page Load Metrics (557 ± 52 ms)
|
This will allow usage in areas where getting the line-height, etc of the typography settings will introduce issues. The mixins have been updated to references these variables so that they can be changed in one place in the future
Member
|
I'm still able to reproduce this bug: #9726 |
This is a continuation of #9726, which did not fix the problem described. If the initial network when the extension is started is something other than Mainnet, the swaps controller will never successfully retrieve swap quotes. This is because `ethers` will continue to communicate with whichever network the provider was initially on. We tried fixing this by hard-coding the `chainId` to Mainnet's `chainId` when constructing the Ethers provider, but this did not work. I suspect this failed because the `provider` we pass to `ethers` is not compliant with EIP 1193, as `ethers` doubtless expects it to be. Instead the entire `ethers` provider is now reconstructed each time the network changes. This mirrors the approach we take in some other controllers.
The v8.1.3 changelog has been updated with all user-facing changes included with v8.1.3 PR #9612 was left under "Current Develop Branch" because it has been temporarily reverted for this release. It was added there now so that we don't forget about it, as the revert might result in that commit not being populated by the changelog script for the next release.
Three new more user-facing changes were added to the release branch.
4b0c344 to
f29a49f
Compare
The changelog has been updated with one minor UX improvement, and the entry regarding failed swap fetches has been updated to point at the PR that actually fixed the issue.
Collaborator
Author
Builds ready [af704db]
Page Load Metrics (396 ± 56 ms)
|
Member
|
So I have tested these changes:
I am not 100% confident that I've tested these correctly, but it seems to be working correctly as far as I can tell:
I'm looking into #9621 at the moment - I am not seeing the aggregator fee 🤔 |
Member
|
I was able to partially confirm #9621 - I saw that it does show the approval fee on the customize gas modal, if present. I was unable to find a quote that had an aggregator fee though, so I was unable to verify that part. |
brad-decker
approved these changes
Oct 28, 2020
Member
Contributor
|
I was able to successfully test the changes of #9621 by using this code in the background console to modifiy the |
danjm
approved these changes
Oct 29, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📦 🚀
v8.1.3 Changelog