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:
parent
7c3ffeb841
commit
a83d26486c
@ -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
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user