mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 17:33:23 +01:00
avoid mutation of state in signTransaction action (#17772)
Co-authored-by: ryanml <ryanlanese@gmail.com>
This commit is contained in:
parent
88b8da79d5
commit
df0ca5a43f
@ -1,7 +1,7 @@
|
||||
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
||||
import BigNumber from 'bignumber.js';
|
||||
import { addHexPrefix } from 'ethereumjs-util';
|
||||
import { debounce } from 'lodash';
|
||||
import { cloneDeep, debounce } from 'lodash';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import {
|
||||
decimalToHex,
|
||||
@ -2270,7 +2270,7 @@ export function signTransaction() {
|
||||
// merge in the modified txParams. Once the transaction has been modified
|
||||
// we can send that to the background to update the transaction in state.
|
||||
const unapprovedTxs = getUnapprovedTxs(state);
|
||||
const unapprovedTx = unapprovedTxs[draftTransaction.id];
|
||||
const unapprovedTx = cloneDeep(unapprovedTxs[draftTransaction.id]);
|
||||
// We only update the tx params that can be changed via the edit flow UX
|
||||
const eip1559OnlyTxParamsToUpdate = {
|
||||
data: txParams.data,
|
||||
|
Loading…
Reference in New Issue
Block a user