diff options
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.js | 8 |
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 +} |