aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/transaction-manager.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-04-28 06:10:16 +0800
committerDan Finlay <dan@danfinlay.com>2017-04-28 06:10:16 +0800
commita9a39bdf8f2b95e8401de6410797a703df91a4e1 (patch)
tree3bc128f651dcd956992fdb2e257269e6507a2f86 /app/scripts/transaction-manager.js
parentf1beb0720a0964e45a71b473f173f62c6abdac6e (diff)
parentd8a5e6a8e43f04a9f123167326fe46dfb8fc2ae6 (diff)
downloadtangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar.gz
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar.bz2
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar.lz
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar.xz
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.tar.zst
tangerine-wallet-browser-a9a39bdf8f2b95e8401de6410797a703df91a4e1.zip
Merge branch 'master' into Version-3.5.4
Diffstat (limited to 'app/scripts/transaction-manager.js')
-rw-r--r--app/scripts/transaction-manager.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/app/scripts/transaction-manager.js b/app/scripts/transaction-manager.js
index d7051b2cb..9f267160f 100644
--- a/app/scripts/transaction-manager.js
+++ b/app/scripts/transaction-manager.js
@@ -28,9 +28,9 @@ module.exports = class TransactionManager extends EventEmitter {
// memstore is computed from a few different stores
this._updateMemstore()
- this.store.subscribe(() => this._updateMemstore() )
- this.networkStore.subscribe(() => this._updateMemstore() )
- this.preferencesStore.subscribe(() => this._updateMemstore() )
+ this.store.subscribe(() => this._updateMemstore())
+ this.networkStore.subscribe(() => this._updateMemstore())
+ this.preferencesStore.subscribe(() => this._updateMemstore())
}
getState () {
@@ -47,8 +47,8 @@ module.exports = class TransactionManager extends EventEmitter {
// Returns the tx list
getTxList () {
- let network = this.getNetwork()
- let fullTxList = this.getFullTxList()
+ const network = this.getNetwork()
+ const fullTxList = this.getFullTxList()
return fullTxList.filter(txMeta => txMeta.metamaskNetworkId === network)
}
@@ -64,10 +64,10 @@ module.exports = class TransactionManager extends EventEmitter {
// Adds a tx to the txlist
addTx (txMeta) {
- let txCount = this.getTxCount()
- let network = this.getNetwork()
- let fullTxList = this.getFullTxList()
- let txHistoryLimit = this.txHistoryLimit
+ const txCount = this.getTxCount()
+ const network = this.getNetwork()
+ const fullTxList = this.getFullTxList()
+ const txHistoryLimit = this.txHistoryLimit
// checks if the length of the tx history is
// longer then desired persistence limit
@@ -197,7 +197,7 @@ module.exports = class TransactionManager extends EventEmitter {
}
fillInTxParams (txId, cb) {
- let txMeta = this.getTx(txId)
+ const txMeta = this.getTx(txId)
this.txProviderUtils.fillInTxParams(txMeta.txParams, (err) => {
if (err) return cb(err)
this.updateTx(txMeta)
@@ -205,7 +205,7 @@ module.exports = class TransactionManager extends EventEmitter {
})
}
- getChainId() {
+ getChainId () {
const networkState = this.networkStore.getState()
const getChainId = parseInt(networkState.network)
if (Number.isNaN(getChainId)) {
@@ -242,7 +242,7 @@ module.exports = class TransactionManager extends EventEmitter {
// receives a txHash records the tx as signed
setTxHash (txId, txHash) {
// Add the tx hash to the persisted meta-tx object
- let txMeta = this.getTx(txId)
+ const txMeta = this.getTx(txId)
txMeta.hash = txHash
this.updateTx(txMeta)
}
@@ -315,7 +315,7 @@ module.exports = class TransactionManager extends EventEmitter {
}
setTxStatusFailed (txId, reason) {
- let txMeta = this.getTx(txId)
+ const txMeta = this.getTx(txId)
txMeta.err = reason
this.updateTx(txMeta)
this._setTxStatus(txId, 'failed')
@@ -338,7 +338,7 @@ module.exports = class TransactionManager extends EventEmitter {
var txHash = txMeta.hash
var txId = txMeta.id
if (!txHash) {
- let errReason = {
+ const errReason = {
errCode: 'No hash was provided',
message: 'We had an error while submitting this transaction, please try again.',
}