aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-04-05 16:04:12 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-04-06 00:54:41 +0800
commit418926ffdfabe8aaefbba5abbf44ebbfd838bbfc (patch)
tree51e020679c76bf237963c431d57f66e44ca40141
parent54b84e2c3d06528bb5efd7d88df7edcf1088f9ae (diff)
downloadtangerine-wallet-browser-418926ffdfabe8aaefbba5abbf44ebbfd838bbfc.tar
tangerine-wallet-browser-418926ffdfabe8aaefbba5abbf44ebbfd838bbfc.tar.gz
tangerine-wallet-browser-418926ffdfabe8aaefbba5abbf44ebbfd838bbfc.tar.bz2
tangerine-wallet-browser-418926ffdfabe8aaefbba5abbf44ebbfd838bbfc.tar.lz
tangerine-wallet-browser-418926ffdfabe8aaefbba5abbf44ebbfd838bbfc.tar.xz
tangerine-wallet-browser-418926ffdfabe8aaefbba5abbf44ebbfd838bbfc.tar.zst
tangerine-wallet-browser-418926ffdfabe8aaefbba5abbf44ebbfd838bbfc.zip
Fix populating txParams with undefined data
-rw-r--r--app/scripts/lib/tx-state-manager.js4
-rw-r--r--ui/app/send-v2.js7
2 files changed, 10 insertions, 1 deletions
diff --git a/app/scripts/lib/tx-state-manager.js b/app/scripts/lib/tx-state-manager.js
index 2ab24d6a0..d8ea17400 100644
--- a/app/scripts/lib/tx-state-manager.js
+++ b/app/scripts/lib/tx-state-manager.js
@@ -108,6 +108,10 @@ module.exports = class TransactionStateManager extends EventEmitter {
updateTx (txMeta, note) {
// validate txParams
if (txMeta.txParams) {
+ if (typeof txMeta.txParams.data === 'undefined') {
+ delete txMeta.txParams.data
+ }
+
this.validateTxParams(txMeta.txParams)
}
diff --git a/ui/app/send-v2.js b/ui/app/send-v2.js
index c3b81da5b..094743ff0 100644
--- a/ui/app/send-v2.js
+++ b/ui/app/send-v2.js
@@ -576,12 +576,17 @@ SendTransactionScreen.prototype.getEditedTx = function () {
data,
})
} else {
- const data = unapprovedTxs[editingTransactionId].txParams.data
+ const { data } = unapprovedTxs[editingTransactionId].txParams
+
Object.assign(editingTx.txParams, {
value: ethUtil.addHexPrefix(amount),
to: ethUtil.addHexPrefix(to),
data,
})
+
+ if (typeof editingTx.txParams.data === 'undefined') {
+ delete editingTx.txParams.data
+ }
}
return editingTx