1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Allow empty recipient fields on tx

This commit is contained in:
Dan Finlay 2016-05-19 16:14:16 -07:00
parent 60270de53d
commit 47540ad0b3
2 changed files with 3 additions and 1 deletions

View File

@ -228,11 +228,11 @@ SendTransactionScreen.prototype.onSubmit = function() {
this.props.dispatch(actions.showLoadingIndication()) this.props.dispatch(actions.showLoadingIndication())
var txParams = { var txParams = {
to: recipient,
from: this.props.address, from: this.props.address,
value: '0x' + value.toString(16), value: '0x' + value.toString(16),
} }
if (recipient) txParams.to = ethUtil.addHexPrefix(recipient)
if (txData) txParams.data = txData if (txData) txParams.data = txData
this.props.dispatch(actions.signTx(txParams)) this.props.dispatch(actions.signTx(txParams))

View File

@ -45,6 +45,7 @@ function valuesFor(obj) {
} }
function addressSummary(address) { function addressSummary(address) {
if (!address) return ''
var checked = ethUtil.toChecksumAddress(address) var checked = ethUtil.toChecksumAddress(address)
return checked ? checked.slice(0,2+8)+'...'+checked.slice(-4) : '...' return checked ? checked.slice(0,2+8)+'...'+checked.slice(-4) : '...'
} }
@ -55,6 +56,7 @@ function isValidAddress(address) {
} }
function isAllOneCase(address) { function isAllOneCase(address) {
if (!address) return true
var lower = address.toLowerCase() var lower = address.toLowerCase()
var upper = address.toUpperCase() var upper = address.toUpperCase()
return address === lower || address === upper return address === lower || address === upper