Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer check network when validating checksum addresses #6280

Merged
merged 2 commits into from
Mar 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ui/app/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ function miniAddressSummary (address) {
function isValidAddress (address, network) {
var prefixed = ethUtil.addHexPrefix(address)
if (address === '0x0000000000000000000000000000000000000000') return false
if (!isEthNetwork(network)) return (ethUtil.isValidAddress(prefixed) && address === address.toLowerCase())
return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed)
}

Expand Down Expand Up @@ -315,7 +314,7 @@ function getTokenAddressFromTokenObject (token) {
*/
function checksumAddress (address, network) {
const checksummed = address ? ethUtil.toChecksumAddress(address) : ''
return checksummed && network && !isEthNetwork(network) ? checksummed.toLowerCase() : checksummed
return checksummed
}

function addressSlicer (address = '') {
Expand Down