1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Snapshot txMeta without cloning history (#8363)

This commit is contained in:
Whymarrh Whitby 2020-04-20 12:26:01 -02:30 committed by GitHub
parent 7c3ffeb841
commit a83d26486c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,13 +62,12 @@ function replayHistory (_shortHistory) {
} }
/** /**
@param {Object} txMeta * Snapshot {@code txMeta}
@returns {Object} - a clone object of the txMeta with out history * @param {Object} txMeta - the tx metadata object
* @returns {Object} a deep clone without history
*/ */
function snapshotFromTxMeta (txMeta) { function snapshotFromTxMeta (txMeta) {
// create txMeta snapshot for history const shallow = { ...txMeta }
const snapshot = cloneDeep(txMeta) delete shallow.history
// dont include previous history in this snapshot return cloneDeep(shallow)
delete snapshot.history
return snapshot
} }