diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-05-20 02:28:58 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-05-20 02:28:58 +0800 |
commit | 685a1881b86c19fe52a7cd82ed4e2b34617429ff (patch) | |
tree | bd69af0994517847138b55844420ca58ddb6ef6b /ui/app | |
parent | e5034ade243d1bf2258f39aabcfe09b9ac602924 (diff) | |
download | tangerine-wallet-browser-685a1881b86c19fe52a7cd82ed4e2b34617429ff.tar tangerine-wallet-browser-685a1881b86c19fe52a7cd82ed4e2b34617429ff.tar.gz tangerine-wallet-browser-685a1881b86c19fe52a7cd82ed4e2b34617429ff.tar.bz2 tangerine-wallet-browser-685a1881b86c19fe52a7cd82ed4e2b34617429ff.tar.lz tangerine-wallet-browser-685a1881b86c19fe52a7cd82ed4e2b34617429ff.tar.xz tangerine-wallet-browser-685a1881b86c19fe52a7cd82ed4e2b34617429ff.tar.zst tangerine-wallet-browser-685a1881b86c19fe52a7cd82ed4e2b34617429ff.zip |
Allow txs with no recipient when they have a data field
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/send.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ui/app/send.js b/ui/app/send.js index 52e56132c..67dd15f81 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -206,20 +206,21 @@ SendTransactionScreen.prototype.back = function() { this.props.dispatch(actions.backToAccountDetail(address)) } -SendTransactionScreen.prototype.onSubmit = function(event) { - var recipient = document.querySelector('input[name="address"]').value +SendTransactionScreen.prototype.onSubmit = function() { - var inputAmount = parseFloat(document.querySelector('input[name="amount"]').value) - var value = util.normalizeNumberToWei(inputAmount, 'ether') - - var balance = this.props.balance + const recipient = document.querySelector('input[name="address"]').value + const inputAmount = parseFloat(document.querySelector('input[name="amount"]').value) + const value = util.normalizeNumberToWei(inputAmount, 'ether') + const txData = document.querySelector('input[name="txData"]').value + const balance = this.props.balance if (value.gt(balance)) { var message = 'Insufficient funds.' return this.props.dispatch(actions.displayWarning(message)) } - if (recipient.length !== 42) { - var message = 'Recipient address is the incorrect length.' + + if ((recipient.length !== 42 && !txData) || (!recipient && !txData)) { + var message = 'Recipient address is invalid.' return this.props.dispatch(actions.displayWarning(message)) } @@ -232,7 +233,6 @@ SendTransactionScreen.prototype.onSubmit = function(event) { value: '0x' + value.toString(16), } - var txData = document.querySelector('input[name="txData"]').value if (txData) txParams.data = txData this.props.dispatch(actions.signTx(txParams)) |