Merge pull request #6280 from MetaMask/network-checksum-disable

No longer check network when validating checksum addresses
feature/default_network_editable
Thomas Huang 6 years ago committed by GitHub
commit c44f7857a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      ui/app/util.js

@ -95,7 +95,6 @@ function miniAddressSummary (address) {
function isValidAddress (address, network) { function isValidAddress (address, network) {
var prefixed = ethUtil.addHexPrefix(address) var prefixed = ethUtil.addHexPrefix(address)
if (address === '0x0000000000000000000000000000000000000000') return false if (address === '0x0000000000000000000000000000000000000000') return false
if (!isEthNetwork(network)) return (ethUtil.isValidAddress(prefixed) && address === address.toLowerCase())
return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed) return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed)
} }
@ -315,7 +314,7 @@ function getTokenAddressFromTokenObject (token) {
*/ */
function checksumAddress (address, network) { function checksumAddress (address, network) {
const checksummed = address ? ethUtil.toChecksumAddress(address) : '' const checksummed = address ? ethUtil.toChecksumAddress(address) : ''
return checksummed && network && !isEthNetwork(network) ? checksummed.toLowerCase() : checksummed return checksummed
} }
function addressSlicer (address = '') { function addressSlicer (address = '') {

Loading…
Cancel
Save