Skip to content

Commit d782f78

Browse files
committed
Remove nonce early
1 parent aeee211 commit d782f78

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

packages/transaction-pay-controller/src/strategy/relay/relay-submit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ describe('Relay Submit Utils', () => {
190190
expect.any(Function),
191191
);
192192

193-
const updateFn = updateTransactionMock.mock.calls[1][1];
194193
const txDraft = { txParams: { nonce: '0x1' } } as TransactionMeta;
195-
updateFn(txDraft);
194+
updateTransactionMock.mock.calls.map((call) => call[1](txDraft));
196195

197196
expect(txDraft).toStrictEqual({
198197
isIntentComplete: true,
198+
requiredTransactionIds: [TRANSACTION_META_MOCK.id],
199199
txParams: {
200200
nonce: undefined,
201201
},

packages/transaction-pay-controller/src/strategy/relay/relay-submit.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,19 @@ async function executeSingleQuote(
9191
networkClientId,
9292
});
9393

94+
if (quote.skipTransaction) {
95+
updateTransaction(
96+
{
97+
transactionId: transaction.id,
98+
messenger,
99+
note: 'Remove nonce from skipped transaction',
100+
},
101+
(tx) => {
102+
tx.txParams.nonce = undefined;
103+
},
104+
);
105+
}
106+
94107
const result = await messenger.call(
95108
'TransactionController:addTransaction',
96109
normalizedParams,
@@ -143,7 +156,6 @@ async function executeSingleQuote(
143156
},
144157
(tx) => {
145158
tx.isIntentComplete = true;
146-
tx.txParams.nonce = undefined;
147159
},
148160
);
149161
}

0 commit comments

Comments
 (0)