Conversation
Collaborator
Builds ready [25a028f]
Page Load Metrics (600 ± 37 ms)
|
ryanml
commented
Apr 25, 2021
Contributor
Author
There was a problem hiding this comment.
this just seemed to be a typo
Collaborator
Builds ready [60ae1b9]
Page Load Metrics (556 ± 43 ms)
|
Collaborator
Builds ready [d6d1f59]
Page Load Metrics (568 ± 38 ms)
|
ryanml
commented
Apr 25, 2021
| if (!to) { | ||
| toError = REQUIRED_ERROR; | ||
| } else if (!isValidAddress(to)) { | ||
| } else if (!isValidAddress(to) && !isValidDomainName(to)) { |
Contributor
Author
There was a problem hiding this comment.
I see we use isValidDomainName throughout the codebase to support ENS checks: https://github.com/MetaMask/metamask-extension/blob/develop/ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js#L57
In this case, it has no improper fall through as part of add-recipient.js. It allows ENS names to move forward, and in the case of a valid domain name, not an ENS name, (ex: brantly.com) it will just default to the address book lookup, as domain names are fine there.
brad-decker
approved these changes
Apr 26, 2021
Contributor
|
Great work, @ryanml |
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.
Fixes #10691
Explanation:
With recent updates to
isValidAddressas provided byethereumjs-util, it is not accepting of invalid hex strings.This adds an
isHexvalidation check to our shared utility forisValidAddressto address the regression. With regards to #10691, we additionally check domain validity so as to not throw an invalid recipient error.Manual testing steps:
Steps for #10691 are defined in the issue. A general regression test should be performed with sending to ENS and hex addresses.
With fix:




