Skip to content

Commit d33fe74

Browse files
authored
replace spread with individual assignment (#872)
queuedTransaction has a "from" field which is the EOA address in the case of userops. The presence of a incorrect "from" address in a userop causes issues like estimation failures. To avoid this, we are selectively passing only the "data" and "value" fields, along with gas overrides.
1 parent b7a4bb7 commit d33fe74

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/worker/tasks/send-transaction-worker.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ const _sendUserOp = async (
216216
{
217217
client: thirdwebClient,
218218
chain,
219-
...queuedTransaction,
220-
...overrides,
219+
data: queuedTransaction.data,
220+
value: queuedTransaction.value,
221+
...overrides, // gas-overrides
221222
to: getChecksumAddress(toAddress),
222223
},
223224
];
@@ -384,7 +385,9 @@ const _sendTransaction = async (
384385
});
385386
populatedTransaction.nonce = nonce;
386387
job.log(
387-
`Populated transaction (isRecycledNonce=${isRecycledNonce}): ${stringify(populatedTransaction)}`,
388+
`Populated transaction (isRecycledNonce=${isRecycledNonce}): ${stringify(
389+
populatedTransaction,
390+
)}`,
388391
);
389392

390393
// Send transaction to RPC.

0 commit comments

Comments
 (0)