From 9b9df417246dbf332f0a7d8afadb664544ceb484 Mon Sep 17 00:00:00 2001 From: frankiebee Date: Fri, 8 Sep 2017 14:24:40 -0700 Subject: more tests and craete a getPendingTransactions function --- app/scripts/controllers/transactions.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'app/scripts/controllers/transactions.js') diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index d71be37d8..636424c64 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -49,12 +49,7 @@ module.exports = class TransactionController extends EventEmitter { this.nonceTracker = new NonceTracker({ provider: this.provider, - getPendingTransactions: (address) => { - return this.txStateManager.getFilteredTxList({ - from: address, - status: 'submitted', - }) - }, + getPendingTransactions: this.txStateManager.getPendingTransactions.bind(this.txStateManager), getConfirmedTransactions: (address) => { return this.txStateManager.getFilteredTxList({ from: address, @@ -73,9 +68,7 @@ module.exports = class TransactionController extends EventEmitter { return account.balance }, publishTransaction: this.query.sendRawTransaction, - getPendingTransactions: () => { - return this.txStateManager.getFilteredTxList({ status: 'submitted' }) - }, + getPendingTransactions: this.txStateManager.getPendingTransactions.bind(this.txStateManager), giveUpOnTransaction: (txId) => { const msg = `Gave up submitting after 3500 blocks un-mined.` this.setTxStatusFailed(txId, msg) @@ -122,8 +115,8 @@ module.exports = class TransactionController extends EventEmitter { return Object.keys(this.txStateManager.getUnapprovedTxList()).length } - getPendingTxCount () { - return this.txStateManager.getTxsByMetaData('status', 'signed').length + getPendingTxCount (account) { + return this.txStateManager.getPendingTransactions(account).length } getChainId () { -- cgit