diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-10-24 07:21:02 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-10-24 07:21:02 +0800 |
commit | b99b5484fec53629a25e9a3e2b4d43f1b1bc7e34 (patch) | |
tree | ae36d1e8a3a0ef8348afcf2684eff1e52d44cd01 /ui | |
parent | 231dc61e3f02d1dfea90d67343f0ebdee3942490 (diff) | |
parent | eba37e773df54276e84d27c02a370719f670cc8b (diff) | |
download | tangerine-wallet-browser-b99b5484fec53629a25e9a3e2b4d43f1b1bc7e34.tar tangerine-wallet-browser-b99b5484fec53629a25e9a3e2b4d43f1b1bc7e34.tar.gz tangerine-wallet-browser-b99b5484fec53629a25e9a3e2b4d43f1b1bc7e34.tar.bz2 tangerine-wallet-browser-b99b5484fec53629a25e9a3e2b4d43f1b1bc7e34.tar.lz tangerine-wallet-browser-b99b5484fec53629a25e9a3e2b4d43f1b1bc7e34.tar.xz tangerine-wallet-browser-b99b5484fec53629a25e9a3e2b4d43f1b1bc7e34.tar.zst tangerine-wallet-browser-b99b5484fec53629a25e9a3e2b4d43f1b1bc7e34.zip |
Merge branch 'master' into i328-MultiVault
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/send.js | 8 | ||||
-rw-r--r-- | ui/app/util.js | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/ui/app/send.js b/ui/app/send.js index 97ed29e4a..b8af19028 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -7,6 +7,7 @@ const actions = require('./actions') const util = require('./util') const numericBalance = require('./util').numericBalance const addressSummary = require('./util').addressSummary +const isHex = require('./util').isHex const EthBalance = require('./components/eth-balance') const ethUtil = require('ethereumjs-util') const RangeSlider = require('./components/range-slider') @@ -190,7 +191,7 @@ SendTransactionScreen.prototype.render = function () { marginBottom: '16px', }, }, [ - 'Transactional Data (optional)', + 'Transaction Data (optional)', ]), // 'data' field @@ -312,6 +313,11 @@ SendTransactionScreen.prototype.onSubmit = function (gasPrice) { return this.props.dispatch(actions.displayWarning(message)) } + if (!isHex(ethUtil.stripHexPrefix(txData)) && txData) { + message = 'Transaction data must be hex string.' + return this.props.dispatch(actions.displayWarning(message)) + } + this.props.dispatch(actions.hideWarning()) var txParams = { 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]+$/)) +} |