aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/actions.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-01 08:54:10 +0800
committerGitHub <noreply@github.com>2017-03-01 08:54:10 +0800
commitf162a11585392df5e593018a02549f8b03018d22 (patch)
treec91dae0c308fb41a461fe85ce4cbeca5b49211df /ui/app/actions.js
parentab01fef1c0ffddf09a20f90a910e5e068cf8c71e (diff)
parenta600ccd4f863d7a473392fc283f4cec248225a27 (diff)
downloadtangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.gz
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.bz2
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.lz
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.xz
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.zst
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.zip
Merge pull request #1154 from MetaMask/i765-gaslimits
Add ability to customize gas and gasPrice on tx confirmation screen
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r--ui/app/actions.js31
1 files changed, 21 insertions, 10 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index 89a4fadfa..7f972fb37 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -94,6 +94,7 @@ var actions = {
cancelPersonalMsg,
sendTx: sendTx,
signTx: signTx,
+ updateAndApproveTx,
cancelTx: cancelTx,
completedTx: completedTx,
txError: txError,
@@ -387,22 +388,18 @@ function signPersonalMsg (msgData) {
function signTx (txData) {
return (dispatch) => {
- log.debug(`background.setGasMultiplier`)
- background.setGasMultiplier(txData.gasMultiplier, (err) => {
+ web3.eth.sendTransaction(txData, (err, data) => {
+ dispatch(actions.hideLoadingIndication())
if (err) return dispatch(actions.displayWarning(err.message))
- web3.eth.sendTransaction(txData, (err, data) => {
- dispatch(actions.hideLoadingIndication())
- if (err) return dispatch(actions.displayWarning(err.message))
- dispatch(actions.hideWarning())
- dispatch(actions.goHome())
- })
- dispatch(this.showConfTxPage())
+ dispatch(actions.hideWarning())
+ dispatch(actions.goHome())
})
+ dispatch(this.showConfTxPage())
}
}
function sendTx (txData) {
- log.info('actions: sendTx')
+ log.info(`actions - sendTx: ${JSON.stringify(txData.txParams)}`)
return (dispatch) => {
log.debug(`actions calling background.approveTransaction`)
background.approveTransaction(txData.id, (err) => {
@@ -415,6 +412,20 @@ function sendTx (txData) {
}
}
+function updateAndApproveTx (txData) {
+ log.info('actions: updateAndApproveTx: ' + JSON.stringify(txData))
+ return (dispatch) => {
+ log.debug(`actions calling background.updateAndApproveTx`)
+ background.updateAndApproveTransaction(txData, (err) => {
+ if (err) {
+ dispatch(actions.txError(err))
+ return console.error(err.message)
+ }
+ dispatch(actions.completedTx(txData.id))
+ })
+ }
+}
+
function completedTx (id) {
return {
type: actions.COMPLETED_TX,