aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/tx-state-manager.js
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2017-10-03 04:41:29 +0800
committerfrankiebee <frankie.diamond@gmail.com>2017-10-03 04:41:29 +0800
commit833da191c37db5b5b470c69a6d4d438ff4719fec (patch)
treedb05de4a0552c53fd628abc0a0a22adb05d77e78 /app/scripts/lib/tx-state-manager.js
parent37979fca68786d20dcdd7edc3d4127ef1ec6afb1 (diff)
downloadtangerine-wallet-browser-833da191c37db5b5b470c69a6d4d438ff4719fec.tar
tangerine-wallet-browser-833da191c37db5b5b470c69a6d4d438ff4719fec.tar.gz
tangerine-wallet-browser-833da191c37db5b5b470c69a6d4d438ff4719fec.tar.bz2
tangerine-wallet-browser-833da191c37db5b5b470c69a6d4d438ff4719fec.tar.lz
tangerine-wallet-browser-833da191c37db5b5b470c69a6d4d438ff4719fec.tar.xz
tangerine-wallet-browser-833da191c37db5b5b470c69a6d4d438ff4719fec.tar.zst
tangerine-wallet-browser-833da191c37db5b5b470c69a6d4d438ff4719fec.zip
transaction - provide notes for history
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')
}