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
|
||||
@returns {Object} - a clone object of the txMeta with out history
|
||||
*/
|
||||
* Snapshot {@code txMeta}
|
||||
* @param {Object} txMeta - the tx metadata object
|
||||
* @returns {Object} a deep clone without history
|
||||
*/
|
||||
function snapshotFromTxMeta (txMeta) {
|
||||
// create txMeta snapshot for history
|
||||
const snapshot = cloneDeep(txMeta)
|
||||
// dont include previous history in this snapshot
|
||||
delete snapshot.history
|
||||
return snapshot
|
||||
const shallow = { ...txMeta }
|
||||
delete shallow.history
|
||||
return cloneDeep(shallow)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user