From 89e690fc794a7cf0af541dbb0c1fd58d73bac368 Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 27 Sep 2017 12:33:00 -0700 Subject: [PATCH 1/3] account-tracker - use new block-tracker block format --- app/scripts/lib/account-tracker.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/scripts/lib/account-tracker.js b/app/scripts/lib/account-tracker.js index e2892b1ce..e550c2758 100644 --- a/app/scripts/lib/account-tracker.js +++ b/app/scripts/lib/account-tracker.js @@ -57,10 +57,8 @@ class AccountTracker extends EventEmitter { // _updateForBlock (block) { - const blockNumber = '0x' + block.number.toString('hex') - this._currentBlockNumber = blockNumber - - this.store.updateState({ currentBlockGasLimit: `0x${block.gasLimit.toString('hex')}` }) + this._currentBlockNumber = block.number + this.store.updateState({ currentBlockGasLimit: block.gasLimit }) async.parallel([ this._updateAccounts.bind(this), From b41aad6d1ae894ab89380b1c7159da8545ad935b Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 27 Sep 2017 12:33:46 -0700 Subject: [PATCH 2/3] style - small whitespace nitpick --- app/scripts/lib/pending-tx-tracker.js | 2 +- test/unit/pending-tx-test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/scripts/lib/pending-tx-tracker.js b/app/scripts/lib/pending-tx-tracker.js index 44e9d50fa..8da1253a2 100644 --- a/app/scripts/lib/pending-tx-tracker.js +++ b/app/scripts/lib/pending-tx-tracker.js @@ -55,7 +55,7 @@ module.exports = class PendingTransactionTracker extends EventEmitter { }) } - queryPendingTxs ({oldBlock, newBlock}) { + queryPendingTxs ({ oldBlock, newBlock }) { // check pending transactions on start if (!oldBlock) { this._checkPendingTxs() diff --git a/test/unit/pending-tx-test.js b/test/unit/pending-tx-test.js index 8c6d287f8..7937afa46 100644 --- a/test/unit/pending-tx-test.js +++ b/test/unit/pending-tx-test.js @@ -84,14 +84,14 @@ describe('PendingTransactionTracker', function () { let newBlock, oldBlock newBlock = { number: '0x01' } pendingTxTracker._checkPendingTxs = done - pendingTxTracker.queryPendingTxs({oldBlock, newBlock}) + pendingTxTracker.queryPendingTxs({ oldBlock, newBlock }) }) it('should call #_checkPendingTxs if oldBlock and the newBlock have a diff of greater then 1', function (done) { let newBlock, oldBlock oldBlock = { number: '0x01' } newBlock = { number: '0x03' } pendingTxTracker._checkPendingTxs = done - pendingTxTracker.queryPendingTxs({oldBlock, newBlock}) + pendingTxTracker.queryPendingTxs({ oldBlock, newBlock }) }) it('should not call #_checkPendingTxs if oldBlock and the newBlock have a diff of 1 or less', function (done) { let newBlock, oldBlock @@ -101,7 +101,7 @@ describe('PendingTransactionTracker', function () { const err = new Error('should not call #_checkPendingTxs if oldBlock and the newBlock have a diff of 1 or less') done(err) } - pendingTxTracker.queryPendingTxs({oldBlock, newBlock}) + pendingTxTracker.queryPendingTxs({ oldBlock, newBlock }) done() }) }) From 7d499df8e32e85f5e4ed5c51f20496028d1dcdbb Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 27 Sep 2017 14:12:45 -0700 Subject: [PATCH 3/3] account-tracker - remove unused import --- app/scripts/lib/account-tracker.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/scripts/lib/account-tracker.js b/app/scripts/lib/account-tracker.js index a108d0d4f..cdc21282d 100644 --- a/app/scripts/lib/account-tracker.js +++ b/app/scripts/lib/account-tracker.js @@ -11,7 +11,6 @@ const async = require('async') const EthQuery = require('eth-query') const ObservableStore = require('obs-store') const EventEmitter = require('events').EventEmitter -const ethUtil = require('ethereumjs-util') function noop () {}