aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/helpers/utils/util.js
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2019-08-03 07:00:50 +0800
committerGitHub <noreply@github.com>2019-08-03 07:00:50 +0800
commit165f44d3a487adc580cc4b68580d3ac42a34bcd0 (patch)
treeccc14f04f635fb35ca87e8349c88b2fa20531f94 /ui/app/helpers/utils/util.js
parent9d5be5d29fcdab1273e30810f87de4624b8622a1 (diff)
downloadtangerine-wallet-browser-165f44d3a487adc580cc4b68580d3ac42a34bcd0.tar
tangerine-wallet-browser-165f44d3a487adc580cc4b68580d3ac42a34bcd0.tar.gz
tangerine-wallet-browser-165f44d3a487adc580cc4b68580d3ac42a34bcd0.tar.bz2
tangerine-wallet-browser-165f44d3a487adc580cc4b68580d3ac42a34bcd0.tar.lz
tangerine-wallet-browser-165f44d3a487adc580cc4b68580d3ac42a34bcd0.tar.xz
tangerine-wallet-browser-165f44d3a487adc580cc4b68580d3ac42a34bcd0.tar.zst
tangerine-wallet-browser-165f44d3a487adc580cc4b68580d3ac42a34bcd0.zip
Address book name save fix (#6945)
* Fix address book name saving and ens input errors on good inputs on unsupported networks * Add initial e2e test for address book send flow. * No longer need to click recipient row in e2e tests * Click write button in address book e2e test on seed confirm screen * Use correct seed phrase and private key in address-book.spec tests
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
+}