aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/transaction-manager.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-02-03 12:59:47 +0800
committerkumavis <aaron@kumavis.me>2017-02-03 12:59:47 +0800
commit0c6df24ecff566c84810a1b29316c1efa2c83870 (patch)
treee621ee6b775d96775bb80082b0afaddb72dee85b /app/scripts/transaction-manager.js
parent99fa9ab13aaf69cb8602612816a4df49209fa8a6 (diff)
downloadtangerine-wallet-browser-0c6df24ecff566c84810a1b29316c1efa2c83870.tar
tangerine-wallet-browser-0c6df24ecff566c84810a1b29316c1efa2c83870.tar.gz
tangerine-wallet-browser-0c6df24ecff566c84810a1b29316c1efa2c83870.tar.bz2
tangerine-wallet-browser-0c6df24ecff566c84810a1b29316c1efa2c83870.tar.lz
tangerine-wallet-browser-0c6df24ecff566c84810a1b29316c1efa2c83870.tar.xz
tangerine-wallet-browser-0c6df24ecff566c84810a1b29316c1efa2c83870.tar.zst
tangerine-wallet-browser-0c6df24ecff566c84810a1b29316c1efa2c83870.zip
metamask - introduce networkStore
Diffstat (limited to 'app/scripts/transaction-manager.js')
-rw-r--r--app/scripts/transaction-manager.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js
index 7949fb854..8d4cf6df3 100644
--- a/app/scripts/transaction-manager.js
+++ b/app/scripts/transaction-manager.js
@@ -12,12 +12,11 @@ module.exports = class TransactionManager extends EventEmitter {
constructor (opts) {
super()
this.store = new ObservableStore(extend({
- txList: [],
+ transactions: [],
gasMultiplier: 1,
}, opts.initState))
this.memStore = new ObservableStore({})
- // this.networkStore = opts.networkStore || new ObservableStore({})
- this.getNetwork = opts.getNetwork
+ this.networkStore = opts.networkStore || new ObservableStore({})
this.txHistoryLimit = opts.txHistoryLimit
this.getSelectedAddress = opts.getSelectedAddress
@@ -31,17 +30,21 @@ module.exports = class TransactionManager extends EventEmitter {
// memstore is computed from diskStore
this._updateMemstore()
this.store.subscribe(() => this._updateMemstore() )
- // this.networkStore.subscribe(() => this._updateMemstore() )
+ this.networkStore.subscribe(() => this._updateMemstore() )
}
getState () {
return this.memStore.getState()
}
+ getNetwork () {
+ return this.networkStore.getState().network
+ }
+
// Returns the tx list
getTxList () {
let network = this.getNetwork()
- let fullTxList = this.store.getState().txList
+ let fullTxList = this.store.getState().transactions
return fullTxList.filter(txMeta => txMeta.metamaskNetworkId === network)
}
@@ -365,8 +368,8 @@ module.exports = class TransactionManager extends EventEmitter {
// Saves the new/updated txList.
// Function is intended only for internal use
- _saveTxList (txList) {
- this.store.updateState({ txList })
+ _saveTxList (transactions) {
+ this.store.updateState({ transactions })
}
_updateMemstore () {