Fixing ENS input entry in send flow (#10923)

* Fixing ENS input entry in send flow

Fixes MetaMask/metamask-extension#10691

* removed unnecessary apostrophe
feature/default_network_editable
ryanml 4 years ago committed by GitHub
parent 9fa6fc9d05
commit f080c10cbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      ui/app/helpers/utils/util.js
  2. 2
      ui/app/pages/send/send-content/add-recipient/add-recipient.js
  3. 2
      ui/app/pages/send/send-content/add-recipient/ens-input.component.js

@ -83,6 +83,9 @@ export function isValidAddress(address) {
return false; return false;
} }
const prefixed = addHexPrefix(address); const prefixed = addHexPrefix(address);
if (!isHex(prefixed)) {
return false;
}
return ( return (
(isAllOneCase(prefixed.slice(2)) && ethUtil.isValidAddress(prefixed)) || (isAllOneCase(prefixed.slice(2)) && ethUtil.isValidAddress(prefixed)) ||
ethUtil.isValidChecksumAddress(prefixed) ethUtil.isValidChecksumAddress(prefixed)

@ -22,7 +22,7 @@ export function getToErrorObject(to, sendTokenAddress, chainId) {
let toError = null; let toError = null;
if (!to) { if (!to) {
toError = REQUIRED_ERROR; toError = REQUIRED_ERROR;
} else if (!isValidAddress(to)) { } else if (!isValidAddress(to) && !isValidDomainName(to)) {
toError = isDefaultMetaMaskChain(chainId) toError = isDefaultMetaMaskChain(chainId)
? INVALID_RECIPIENT_ADDRESS_ERROR ? INVALID_RECIPIENT_ADDRESS_ERROR
: INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR; : INVALID_RECIPIENT_ADDRESS_NOT_ETH_NETWORK_ERROR;

@ -314,7 +314,7 @@ export default class EnsInput extends Component {
} }
if (ensFailure) { if (ensFailure) {
return <i className="fa fa-warning fa-lg warning'" />; return <i className="fa fa-warning fa-lg warning" />;
} }
if (ensResolution && ensResolution !== ZERO_ADDRESS) { if (ensResolution && ensResolution !== ZERO_ADDRESS) {

Loading…
Cancel
Save