aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/helpers/utils/util.js
diff options
context:
space:
mode:
authorDan Finlay <542863+danfinlay@users.noreply.github.com>2019-08-07 05:53:50 +0800
committerGitHub <noreply@github.com>2019-08-07 05:53:50 +0800
commitdb08881d4527e8a037f401ef22b849e52152864f (patch)
tree6032d7a4ae67371889eece1d8490c26d5a119dd5 /ui/app/helpers/utils/util.js
parent4139019d0f4dd83f56da400ca7e0e6d1976d1716 (diff)
parent86ad9564a064fd6158dab6a3c9e5b10614ef6e68 (diff)
downloadtangerine-wallet-browser-7.0.0.tar.gz
tangerine-wallet-browser-7.0.0.tar.zst
tangerine-wallet-browser-7.0.0.zip
Merge pull request #6969 from MetaMask/developv7.0.0
Master Version Bump
Diffstat (limited to 'ui/app/helpers/utils/util.js')
-rw-r--r--ui/app/helpers/utils/util.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/app/helpers/utils/util.js b/ui/app/helpers/utils/util.js
index 94fa9ad42..b9e8e83c5 100644
--- a/ui/app/helpers/utils/util.js
+++ b/ui/app/helpers/utils/util.js
@@ -61,6 +61,7 @@ module.exports = {
checksumAddress,
addressSlicer,
isEthNetwork,
+ isValidAddressHead,
}
function isEthNetwork (netId) {
@@ -323,3 +324,10 @@ function addressSlicer (address = '') {
return `${address.slice(0, 6)}...${address.slice(-4)}`
}
+
+function isValidAddressHead (address) {
+ const addressLengthIsLessThanFull = address.length < 42
+ const addressIsHex = isHex(address)
+
+ return addressLengthIsLessThanFull && addressIsHex
+}