diff options
author | Dan Finlay <flyswatter@users.noreply.github.com> | 2017-03-23 06:38:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-23 06:38:54 +0800 |
commit | 5b81f7120b3c7c3c3a16246a9d5705fcab4f91b9 (patch) | |
tree | a9c553435ef7bb08b3bf2dc7278ccbd181cab4e4 | |
parent | 33ba38df6e3d2e088442968261c740e892387411 (diff) | |
parent | 7e6445110a4a5c6a792fec8d3b899cec05e169fd (diff) | |
download | tangerine-wallet-browser-5b81f7120b3c7c3c3a16246a9d5705fcab4f91b9.tar tangerine-wallet-browser-5b81f7120b3c7c3c3a16246a9d5705fcab4f91b9.tar.gz tangerine-wallet-browser-5b81f7120b3c7c3c3a16246a9d5705fcab4f91b9.tar.bz2 tangerine-wallet-browser-5b81f7120b3c7c3c3a16246a9d5705fcab4f91b9.tar.lz tangerine-wallet-browser-5b81f7120b3c7c3c3a16246a9d5705fcab4f91b9.tar.xz tangerine-wallet-browser-5b81f7120b3c7c3c3a16246a9d5705fcab4f91b9.tar.zst tangerine-wallet-browser-5b81f7120b3c7c3c3a16246a9d5705fcab4f91b9.zip |
Merge pull request #1244 from MetaMask/i1227-uidumpblockhash
Add current block number and hash to the state.
-rw-r--r-- | app/scripts/lib/eth-store.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/scripts/lib/eth-store.js b/app/scripts/lib/eth-store.js index 8812a507b..243253df2 100644 --- a/app/scripts/lib/eth-store.js +++ b/app/scripts/lib/eth-store.js @@ -19,6 +19,8 @@ class EthereumStore extends ObservableStore { super({ accounts: {}, transactions: {}, + currentBlockNumber: '0', + currentBlockHash: '', }) this._provider = opts.provider this._query = new EthQuery(this._provider) @@ -69,6 +71,8 @@ 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')}`}) async.parallel([ this._updateAccounts.bind(this), this._updateTransactions.bind(this, blockNumber), @@ -129,4 +133,4 @@ class EthereumStore extends ObservableStore { } -module.exports = EthereumStore
\ No newline at end of file +module.exports = EthereumStore |