diff options
author | kumavis <kumavis@users.noreply.github.com> | 2016-05-05 02:11:37 +0800 |
---|---|---|
committer | kumavis <kumavis@users.noreply.github.com> | 2016-05-05 02:11:37 +0800 |
commit | 95582f8bde3abda5b6b7cf0e027bc7913e5953ce (patch) | |
tree | 6409dd6ea4aee0f58e243959568a4dca3fd0e63d /ui/app/actions.js | |
parent | dcbf17af2d547ce676178bf78328d5c01135e31a (diff) | |
parent | 9c6ec054b13f24e88b78ca4124b0d3a46234b1d7 (diff) | |
download | tangerine-wallet-browser-95582f8bde3abda5b6b7cf0e027bc7913e5953ce.tar tangerine-wallet-browser-95582f8bde3abda5b6b7cf0e027bc7913e5953ce.tar.gz tangerine-wallet-browser-95582f8bde3abda5b6b7cf0e027bc7913e5953ce.tar.bz2 tangerine-wallet-browser-95582f8bde3abda5b6b7cf0e027bc7913e5953ce.tar.lz tangerine-wallet-browser-95582f8bde3abda5b6b7cf0e027bc7913e5953ce.tar.xz tangerine-wallet-browser-95582f8bde3abda5b6b7cf0e027bc7913e5953ce.tar.zst tangerine-wallet-browser-95582f8bde3abda5b6b7cf0e027bc7913e5953ce.zip |
Merge pull request #169 from MetaMask/ImplementEthSign
implement eth_sign
Diffstat (limited to 'ui/app/actions.js')
-rw-r--r-- | ui/app/actions.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js index 12e20e0cf..072139e1a 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -42,6 +42,7 @@ var actions = { SHOW_ACCOUNT_DETAIL: 'SHOW_ACCOUNT_DETAIL', SHOW_ACCOUNTS_PAGE: 'SHOW_ACCOUNTS_PAGE', SHOW_CONF_TX_PAGE: 'SHOW_CONF_TX_PAGE', + SHOW_CONF_MSG_PAGE: 'SHOW_CONF_MSG_PAGE', // account detail screen SHOW_SEND_PAGE: 'SHOW_SEND_PAGE', showSendPage: showSendPage, @@ -57,7 +58,8 @@ var actions = { NEXT_TX: 'NEXT_TX', PREVIOUS_TX: 'PREV_TX', setSelectedAddress: setSelectedAddress, - signTx: signTx, + signMsg: signMsg, + cancelMsg: cancelMsg, sendTx: sendTx, cancelTx: cancelTx, completedTx: completedTx, @@ -111,7 +113,6 @@ function tryUnlockMetamask(password) { dispatch(this.unlockFailed()) } else { dispatch(this.unlockMetamask()) - dispatch(this.showAccountDetail(selectedAccount)) } }) } @@ -152,16 +153,15 @@ function setSelectedAddress(address) { } } -function signTx(txData) { +function signMsg(msgData) { return (dispatch) => { dispatch(this.showLoadingIndication()) - web3.eth.sendTransaction(txData, (err, data) => { + _accountManager.signMessage(msgData, (err) => { dispatch(this.hideLoadingIndication()) if (err) return dispatch(this.displayWarning(err.message)) - dispatch(this.hideWarning()) - dispatch(this.goHome()) + dispatch(this.completedTx(msgData.metamaskId)) }) } } @@ -193,9 +193,14 @@ function txError(err) { } } +function cancelMsg(msgData){ + _accountManager.cancelMessage(msgData.id) + return this.completedTx(msgData.id) +} + function cancelTx(txData){ _accountManager.cancelTransaction(txData.id) - return this.goHome() + return this.completedTx(txData.id) } // |