aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/tx-state-manager.js
diff options
context:
space:
mode:
authorSergey Ukustov <sergey@ukstv.me>2017-10-03 07:10:47 +0800
committerSergey Ukustov <sergey@ukstv.me>2017-10-03 07:10:47 +0800
commite11ca1289019123cd143adcb6312186452630723 (patch)
tree4debbc517ee74b3bc307def4f64aa98907571167 /app/scripts/lib/tx-state-manager.js
parent82d1f391986ac6f7cb7d9029f50d44b5a8c9442b (diff)
parentb7c195160238119291ce62b01db1c8f7e4f94568 (diff)
downloadtangerine-wallet-browser-e11ca1289019123cd143adcb6312186452630723.tar
tangerine-wallet-browser-e11ca1289019123cd143adcb6312186452630723.tar.gz
tangerine-wallet-browser-e11ca1289019123cd143adcb6312186452630723.tar.bz2
tangerine-wallet-browser-e11ca1289019123cd143adcb6312186452630723.tar.lz
tangerine-wallet-browser-e11ca1289019123cd143adcb6312186452630723.tar.xz
tangerine-wallet-browser-e11ca1289019123cd143adcb6312186452630723.tar.zst
tangerine-wallet-browser-e11ca1289019123cd143adcb6312186452630723.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'app/scripts/lib/tx-state-manager.js')
-rw-r--r--app/scripts/lib/tx-state-manager.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/scripts/lib/tx-state-manager.js b/app/scripts/lib/tx-state-manager.js
index abb9d7910..cf8117864 100644
--- a/app/scripts/lib/tx-state-manager.js
+++ b/app/scripts/lib/tx-state-manager.js
@@ -82,7 +82,7 @@ module.exports = class TransactionStateManger extends EventEmitter {
return txMeta
}
- updateTx (txMeta) {
+ updateTx (txMeta, note) {
if (txMeta.txParams) {
Object.keys(txMeta.txParams).forEach((key) => {
let value = txMeta.txParams[key]
@@ -96,8 +96,8 @@ module.exports = class TransactionStateManger extends EventEmitter {
// recover previous tx state obj
const previousState = txStateHistoryHelper.replayHistory(txMeta.history)
// generate history entry and add to history
- const entry = txStateHistoryHelper.generateHistoryEntry(previousState, currentState)
- txMeta.history.push(entry)
+ const entry = txStateHistoryHelper.generateHistoryEntry(previousState, currentState, note)
+ txMeta.history.push(entry)
// commit txMeta to state
const txId = txMeta.id
@@ -113,7 +113,7 @@ module.exports = class TransactionStateManger extends EventEmitter {
updateTxParams (txId, txParams) {
const txMeta = this.getTx(txId)
txMeta.txParams = extend(txMeta.txParams, txParams)
- this.updateTx(txMeta)
+ this.updateTx(txMeta, `txStateManager#updateTxParams`)
}
/*
@@ -233,7 +233,7 @@ module.exports = class TransactionStateManger extends EventEmitter {
if (status === 'submitted' || status === 'rejected') {
this.emit(`${txMeta.id}:finished`, txMeta)
}
- this.updateTx(txMeta)
+ this.updateTx(txMeta, `txStateManager: setting status to ${status}`)
this.emit('update:badge')
}