aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-10-22 08:24:04 +0800
committerGitHub <noreply@github.com>2016-10-22 08:24:04 +0800
commiteba37e773df54276e84d27c02a370719f670cc8b (patch)
tree8e433c62f71cd60eafa25a834a99109801417954 /ui/app/util.js
parent8d2ec8b820e500a936fad334ae504d5bd50d3d48 (diff)
parent7d9e295b759ccd1ca77e286651c3da71284631e3 (diff)
downloadtangerine-wallet-browser-eba37e773df54276e84d27c02a370719f670cc8b.tar
tangerine-wallet-browser-eba37e773df54276e84d27c02a370719f670cc8b.tar.gz
tangerine-wallet-browser-eba37e773df54276e84d27c02a370719f670cc8b.tar.bz2
tangerine-wallet-browser-eba37e773df54276e84d27c02a370719f670cc8b.tar.lz
tangerine-wallet-browser-eba37e773df54276e84d27c02a370719f670cc8b.tar.xz
tangerine-wallet-browser-eba37e773df54276e84d27c02a370719f670cc8b.tar.zst
tangerine-wallet-browser-eba37e773df54276e84d27c02a370719f670cc8b.zip
Merge pull request #752 from MetaMask/i#741
Add validations to txData param in send form
Diffstat (limited to 'ui/app/util.js')
-rw-r--r--ui/app/util.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/app/util.js b/ui/app/util.js
index e4b77e2bc..7a56bf6a0 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -35,6 +35,7 @@ module.exports = {
normalizeNumberToWei: normalizeNumberToWei,
valueTable: valueTable,
bnTable: bnTable,
+ isHex: isHex,
}
function valuesFor (obj) {
@@ -209,3 +210,7 @@ function readableDate (ms) {
var time = `${hours}:${minutes.substr(-2)}:${seconds.substr(-2)}`
return `${dateStr} ${time}`
}
+
+function isHex (str) {
+ return Boolean(str.match(/^(0x)?[0-9a-fA-F]+$/))
+}