diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-09-23 04:33:53 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-09-23 04:33:53 +0800 |
commit | 977405fc7d89256a911e73b83a6678235fa1cfb8 (patch) | |
tree | 60116b2b8fc56a33010936c07c6a4c6709f9163e /app | |
parent | c9585f166f3aebea29e7214026a942eb18e4884a (diff) | |
download | tangerine-wallet-browser-977405fc7d89256a911e73b83a6678235fa1cfb8.tar tangerine-wallet-browser-977405fc7d89256a911e73b83a6678235fa1cfb8.tar.gz tangerine-wallet-browser-977405fc7d89256a911e73b83a6678235fa1cfb8.tar.bz2 tangerine-wallet-browser-977405fc7d89256a911e73b83a6678235fa1cfb8.tar.lz tangerine-wallet-browser-977405fc7d89256a911e73b83a6678235fa1cfb8.tar.xz tangerine-wallet-browser-977405fc7d89256a911e73b83a6678235fa1cfb8.tar.zst tangerine-wallet-browser-977405fc7d89256a911e73b83a6678235fa1cfb8.zip |
Remove dead code from eth-store
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/lib/eth-store.js | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/app/scripts/lib/eth-store.js b/app/scripts/lib/eth-store.js index ebba98f5c..ff22eca4a 100644 --- a/app/scripts/lib/eth-store.js +++ b/app/scripts/lib/eth-store.js @@ -18,10 +18,6 @@ class EthereumStore extends ObservableStore { constructor (opts = {}) { super({ accounts: {}, - transactions: {}, - currentBlockNumber: '0', - currentBlockHash: '', - currentBlockGasLimit: '', }) this._provider = opts.provider this._query = new EthQuery(this._provider) @@ -50,21 +46,6 @@ class EthereumStore extends ObservableStore { this.updateState({ accounts }) } - addTransaction (txHash) { - const transactions = this.getState().transactions - transactions[txHash] = {} - this.updateState({ transactions }) - if (!this._currentBlockNumber) return - this._updateTransaction(this._currentBlockNumber, txHash, noop) - } - - removeTransaction (txHash) { - const transactions = this.getState().transactions - delete transactions[txHash] - this.updateState({ transactions }) - } - - // // private // @@ -72,12 +53,9 @@ class EthereumStore extends ObservableStore { _updateForBlock (block) { const blockNumber = '0x' + block.number.toString('hex') this._currentBlockNumber = blockNumber - this.updateState({ currentBlockNumber: parseInt(blockNumber) }) - this.updateState({ currentBlockHash: `0x${block.hash.toString('hex')}`}) - this.updateState({ currentBlockGasLimit: `0x${block.gasLimit.toString('hex')}` }) + async.parallel([ this._updateAccounts.bind(this), - this._updateTransactions.bind(this, blockNumber), ], (err) => { if (err) return console.error(err) this.emit('block', this.getState()) @@ -104,26 +82,6 @@ class EthereumStore extends ObservableStore { }) } - _updateTransactions (block, cb = noop) { - const transactions = this.getState().transactions - const txHashes = Object.keys(transactions) - async.each(txHashes, this._updateTransaction.bind(this, block), cb) - } - - _updateTransaction (block, txHash, cb = noop) { - // would use the block here to determine how many confirmations the tx has - const transactions = this.getState().transactions - this._query.getTransaction(txHash, (err, result) => { - if (err) return cb(err) - // only populate if the entry is still present - if (transactions[txHash]) { - transactions[txHash] = result - this.updateState({ transactions }) - } - cb(null, result) - }) - } - _getAccount (address, cb = noop) { const query = this._query async.parallel({ |