aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/tx-state-manager.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2017-10-03 05:11:50 +0800
committerGitHub <noreply@github.com>2017-10-03 05:11:50 +0800
commitb7c195160238119291ce62b01db1c8f7e4f94568 (patch)
tree01e7afaf1ae3e374a1dd27e8ee564f3370d4463b /app/scripts/lib/tx-state-manager.js
parentbf390bd63d7642d5a4975c572eb928252122a79b (diff)
parent167ad729fdd4fa23a2ec66e648652f3379a2bb51 (diff)
downloadtangerine-wallet-browser-b7c195160238119291ce62b01db1c8f7e4f94568.tar
tangerine-wallet-browser-b7c195160238119291ce62b01db1c8f7e4f94568.tar.gz
tangerine-wallet-browser-b7c195160238119291ce62b01db1c8f7e4f94568.tar.bz2
tangerine-wallet-browser-b7c195160238119291ce62b01db1c8f7e4f94568.tar.lz
tangerine-wallet-browser-b7c195160238119291ce62b01db1c8f7e4f94568.tar.xz
tangerine-wallet-browser-b7c195160238119291ce62b01db1c8f7e4f94568.tar.zst
tangerine-wallet-browser-b7c195160238119291ce62b01db1c8f7e4f94568.zip
Merge pull request #2260 from MetaMask/history-notes
transaction - provide notes for history
Diffstat (limited to 'app/scripts/lib/tx-state-manager.js')
-rw-r--r--app/scripts/lib/tx-state-manager.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/scripts/lib/tx-state-manager.js b/app/scripts/lib/tx-state-manager.js
index 4493889bf..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,7 +96,7 @@ 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)
+ const entry = txStateHistoryHelper.generateHistoryEntry(previousState, currentState, note)
txMeta.history.push(entry)
// commit txMeta to state
@@ -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')
}