1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02: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())
var txParams = {
to: recipient,
from: this.props.address,
value: '0x' + value.toString(16),
}
if (recipient) txParams.to = ethUtil.addHexPrefix(recipient)
if (txData) txParams.data = txData
this.props.dispatch(actions.signTx(txParams))

View File

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