aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-09-21 00:40:33 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-09-21 00:40:33 +0800
commitb22783a223e84e541db9c1e2d411ef27f62d7e62 (patch)
tree6ad0809ed79a0e1aa7e5934616779168324ec143 /ui/app/util.js
parentbd8428e9ed3e1fb386620def0739720aa8985299 (diff)
parent9bd55f4897938bfdc363987252be6f5f390ab7a5 (diff)
downloadtangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar.gz
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar.bz2
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar.lz
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar.xz
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar.zst
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.zip
Merge branch 'master' into new-currency-test
Diffstat (limited to 'ui/app/util.js')
-rw-r--r--ui/app/util.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/app/util.js b/ui/app/util.js
index 1368ebf11..3f8b4dcc3 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -37,6 +37,7 @@ module.exports = {
bnTable: bnTable,
isHex: isHex,
exportAsFile: exportAsFile,
+ isInvalidChecksumAddress,
}
function valuesFor (obj) {
@@ -66,6 +67,12 @@ function isValidAddress (address) {
return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed)
}
+function isInvalidChecksumAddress (address) {
+ var prefixed = ethUtil.addHexPrefix(address)
+ if (address === '0x0000000000000000000000000000000000000000') return false
+ return !isAllOneCase(prefixed) && !ethUtil.isValidChecksumAddress(prefixed) && ethUtil.isValidAddress(prefixed)
+}
+
function isAllOneCase (address) {
if (!address) return true
var lower = address.toLowerCase()