diff options
author | Alexander Tseung <alextsg@users.noreply.github.com> | 2018-09-25 02:34:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-25 02:34:12 +0800 |
commit | 5d57c7c4fd17f1841e33d31e3b13dcc13aef5b3e (patch) | |
tree | 9d310e5a5689dfa27edb508197ef4811e2786f95 /app | |
parent | 24d8d4ae0077a3adbcdd6c37e4ddc476228195a6 (diff) | |
parent | 431beb943675f2e9b7b5e5ce9c7f55d45f10905f (diff) | |
download | tangerine-wallet-browser-5d57c7c4fd17f1841e33d31e3b13dcc13aef5b3e.tar tangerine-wallet-browser-5d57c7c4fd17f1841e33d31e3b13dcc13aef5b3e.tar.gz tangerine-wallet-browser-5d57c7c4fd17f1841e33d31e3b13dcc13aef5b3e.tar.bz2 tangerine-wallet-browser-5d57c7c4fd17f1841e33d31e3b13dcc13aef5b3e.tar.lz tangerine-wallet-browser-5d57c7c4fd17f1841e33d31e3b13dcc13aef5b3e.tar.xz tangerine-wallet-browser-5d57c7c4fd17f1841e33d31e3b13dcc13aef5b3e.tar.zst tangerine-wallet-browser-5d57c7c4fd17f1841e33d31e3b13dcc13aef5b3e.zip |
Merge pull request #5282 from MetaMask/tx-cancel-ui
Add Cancel Transaction feature. Refactor modals. Add Transaction Details modal.
Diffstat (limited to 'app')
-rw-r--r-- | app/_locales/en/messages.json | 18 | ||||
-rw-r--r-- | app/scripts/controllers/transactions/index.js | 5 |
2 files changed, 21 insertions, 2 deletions
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 951e24ec1..f6cf7cf69 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -61,6 +61,12 @@ "attemptingConnect": { "message": "Attempting to connect to blockchain." }, + "attemptToCancel": { + "message": "Attempt to Cancel?" + }, + "attemptToCancelDescription": { + "message": "Attempting to cancel does not guarantee your original transaction will be cancelled. If cancelled, you are still required to pay a transaction fee to the network." + }, "attributions": { "message": "Attributions" }, @@ -116,6 +122,12 @@ "cancel": { "message": "Cancel" }, + "cancelAttempt": { + "message": "Cancel Attempt" + }, + "cancellationGasFee": { + "message": "Cancellation Gas Fee" + }, "classicInterface": { "message": "Use classic interface" }, @@ -1109,6 +1121,9 @@ "transactionCreated": { "message": "Transaction created with a value of $1 on $2." }, + "transactionWithNonce": { + "message": "Transaction $1" + }, "transactionDropped": { "message": "Transaction dropped on $2." }, @@ -1240,6 +1255,9 @@ "whatsThis": { "message": "What's this?" }, + "yesLetsTry": { + "message": "Yes, let's try" + }, "youNeedToAllowCameraAccess": { "message": "You need to allow camera access to use this feature." }, diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 59e30cdde..e2965ceb6 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -18,7 +18,7 @@ const { TRANSACTION_STATUS_APPROVED, } = require('./enums') -const { hexToBn, bnToHex } = require('../../lib/util') +const { hexToBn, bnToHex, BnMultiplyByFraction } = require('../../lib/util') /** Transaction Controller is an aggregate of sub-controllers and trackers @@ -244,7 +244,8 @@ class TransactionController extends EventEmitter { const originalTxMeta = this.txStateManager.getTx(originalTxId) const { txParams } = originalTxMeta const { gasPrice: lastGasPrice, from, nonce } = txParams - const newGasPrice = customGasPrice || bnToHex(hexToBn(lastGasPrice).mul(1.1)) + + const newGasPrice = customGasPrice || bnToHex(BnMultiplyByFraction(hexToBn(lastGasPrice), 11, 10)) const newTxMeta = this.txStateManager.generateTxMeta({ txParams: { from, |