aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/tx-state-history-helper.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-history-helper.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-history-helper.js')
-rw-r--r--app/scripts/lib/tx-state-history-helper.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/scripts/lib/tx-state-history-helper.js b/app/scripts/lib/tx-state-history-helper.js
index 5ebd78689..db6e3bc9f 100644
--- a/app/scripts/lib/tx-state-history-helper.js
+++ b/app/scripts/lib/tx-state-history-helper.js
@@ -20,8 +20,11 @@ function migrateFromSnapshotsToDiffs(longHistory) {
)
}
-function generateHistoryEntry(previousState, newState) {
- return jsonDiffer.compare(previousState, newState)
+function generateHistoryEntry(previousState, newState, note) {
+ const entry = jsonDiffer.compare(previousState, newState)
+ // Add a note to the first op, since it breaks if we append it to the entry
+ if (note && entry[0]) entry[0].note = note
+ return entry
}
function replayHistory(_shortHistory) {