From 18a8a211799645886efeaba875b5aa8f80773e7f Mon Sep 17 00:00:00 2001 From: Bryce Neal Date: Mon, 30 Apr 2018 14:35:47 -0700 Subject: Blacklist problematic shopify iFrame --- app/scripts/contentscript.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/scripts') diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js index dbf1c6d4c..ddf1a9432 100644 --- a/app/scripts/contentscript.js +++ b/app/scripts/contentscript.js @@ -174,6 +174,7 @@ function blacklistedDomainCheck () { 'uscourts.gov', 'dropbox.com', 'webbyawards.com', + 'cdn.shopify.com/s/javascripts/tricorder/xtld-read-only-frame.html', ] var currentUrl = window.location.href var currentRegex -- cgit From 62bf76db53cf0702739d2735edfe8ffcb142b7c2 Mon Sep 17 00:00:00 2001 From: frankiebee Date: Tue, 1 May 2018 13:57:14 -0700 Subject: fix - getTxsByMetaData check if the key is in the object not if the value is truthy --- app/scripts/controllers/transactions/tx-state-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/scripts') diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js index 53428c333..380214c1d 100644 --- a/app/scripts/controllers/transactions/tx-state-manager.js +++ b/app/scripts/controllers/transactions/tx-state-manager.js @@ -262,7 +262,7 @@ class TransactionStateManager extends EventEmitter { */ getTxsByMetaData (key, value, txList = this.getTxList()) { return txList.filter((txMeta) => { - if (txMeta.txParams[key]) { + if (key in txMeta.txParams) { return txMeta.txParams[key] === value } else { return txMeta[key] === value -- cgit From a45cb754358ff798dce25fa0b44d6b182abc7692 Mon Sep 17 00:00:00 2001 From: frankiebee Date: Tue, 1 May 2018 13:57:43 -0700 Subject: transactions - add a nonce check utility for ui use --- app/scripts/controllers/transactions/index.js | 15 +++++++++++++++ app/scripts/metamask-controller.js | 1 + 2 files changed, 16 insertions(+) (limited to 'app/scripts') diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 541f1db73..a1588cfef 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -111,6 +111,21 @@ class TransactionController extends EventEmitter { this.txStateManager.wipeTransactions(address) } + /** + Check if a txMeta in the list with the same nonce has been confirmed in a block + if the txParams dont have a nonce will return false + @returns {boolean} weather the nonce has been used in a transaction confirmed in a block + @param {object} txMeta - the txMeta object + */ + async isNonceTaken (txMeta) { + const { from, nonce } = txMeta.txParams + if ('nonce' in txMeta.txParams) { + const sameNonceTxList = this.txStateManager.getFilteredTxList({from, nonce, status: 'confirmed'}) + return (sameNonceTxList.length >= 1) + } + return false + } + /** add a new unapproved transaction to the pipeline diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index c4a73d8ea..a90acb4d5 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -382,6 +382,7 @@ module.exports = class MetamaskController extends EventEmitter { updateTransaction: nodeify(txController.updateTransaction, txController), updateAndApproveTransaction: nodeify(txController.updateAndApproveTransaction, txController), retryTransaction: nodeify(this.retryTransaction, this), + isNonceTaken: nodeify(txController.isNonceTaken, txController), // messageManager signMessage: nodeify(this.signMessage, this), -- cgit From 6351b7bb8853dab4c2a87ae7473ef1c10c03dd20 Mon Sep 17 00:00:00 2001 From: bitpshr Date: Mon, 7 May 2018 15:08:43 -0400 Subject: Fix documentation typo --- app/scripts/controllers/transactions/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/scripts') diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index a1588cfef..3886db104 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -114,7 +114,7 @@ class TransactionController extends EventEmitter { /** Check if a txMeta in the list with the same nonce has been confirmed in a block if the txParams dont have a nonce will return false - @returns {boolean} weather the nonce has been used in a transaction confirmed in a block + @returns {boolean} whether the nonce has been used in a transaction confirmed in a block @param {object} txMeta - the txMeta object */ async isNonceTaken (txMeta) { -- cgit