Skip to content

Commit 097124d

Browse files
committed
chore: clean up and changelogs
1 parent 1e6520d commit 097124d

File tree

4 files changed

+4
-28
lines changed

4 files changed

+4
-28
lines changed

packages/transaction-controller/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Add estimate gas limit for transaction batch using simulation API ([#5852](https://github.com/MetaMask/core/pull/5852))
1213
- Add optional approval request when calling `addTransactionBatch` ([#5793](https://github.com/MetaMask/core/pull/5793))
1314
- Add `transactionBatches` array to state.
1415
- Add `TransactionBatchMeta` type.

packages/transaction-controller/src/types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,6 @@ export type TransactionBatchMeta = {
524524
*/
525525
origin?: string;
526526

527-
/** When the transaction was saved in the metadata. */
528-
time: number;
529-
530527
/**
531528
* Data for any EIP-7702 transactions.
532529
*/

packages/transaction-controller/src/utils/batch.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,6 @@ describe('Batch Utils', () => {
15341534
},
15351535
],
15361536
origin: ORIGIN_MOCK,
1537-
time: expect.any(Number),
15381537
}),
15391538
]);
15401539

packages/transaction-controller/src/utils/batch.ts

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,6 @@ async function addTransactionBatchWithHook(
411411
const transactionCount = nestedTransactions.length;
412412
const collectHook = new CollectPublishHook(transactionCount);
413413
try {
414-
console.log('Collecting publish hook >>>>', requireApproval, useHook);
415414
if (requireApproval && useHook) {
416415
const { gasLimit, transactions: transactionsWithGas } =
417416
await simulateGasBatch({
@@ -423,7 +422,6 @@ async function addTransactionBatchWithHook(
423422
// resigned the transactions with simulated gas
424423
nestedTransactions = transactionsWithGas;
425424

426-
console.log('transactions simulated >>>>', transactionsWithGas);
427425
const txBatchMeta = newBatchMetadata({
428426
id: batchId,
429427
chainId,
@@ -433,18 +431,16 @@ async function addTransactionBatchWithHook(
433431
from,
434432
gas: gasLimit,
435433
});
436-
console.log('1 txBatchMeta >>>>', txBatchMeta?.transactions?.[0]);
437434
addBatchMetadata(txBatchMeta, update);
438435

439436
resultCallbacks = (await requestApproval(txBatchMeta, messenger))
440437
.resultCallbacks;
441-
console.log('resultCallbacks >>>>', resultCallbacks);
442438
}
443439

444440
const publishHook = collectHook.getHook();
445441
const hookTransactions: Omit<PublishBatchHookTransaction, 'signedTx'>[] =
446442
[];
447-
console.log('1 >>>>', nestedTransactions);
443+
448444
for (const nestedTransaction of nestedTransactions) {
449445
const hookTransaction = await processTransactionWithHook(
450446
batchId,
@@ -455,22 +451,15 @@ async function addTransactionBatchWithHook(
455451

456452
hookTransactions.push(hookTransaction);
457453
}
458-
console.log('1.5 >>>>');
459454

460455
const { signedTransactions } = await collectHook.ready();
461-
console.log('2 signedTransactions >>>>', signedTransactions);
462456

463457
const transactions = hookTransactions.map((transaction, index) => ({
464458
...transaction,
465459
signedTx: signedTransactions[index],
466460
}));
467461

468462
log('Calling publish batch hook', { from, networkClientId, transactions });
469-
console.log('Calling publish batch hook', {
470-
from,
471-
networkClientId,
472-
transactions,
473-
});
474463

475464
const result = await publishBatchHook({
476465
from,
@@ -479,7 +468,6 @@ async function addTransactionBatchWithHook(
479468
});
480469

481470
log('Publish batch hook result', result);
482-
console.log('Publish batch hook result', result);
483471

484472
if (!result) {
485473
throw new Error('Publish batch hook did not return a result');
@@ -491,7 +479,6 @@ async function addTransactionBatchWithHook(
491479

492480
collectHook.success(transactionHashes);
493481
resultCallbacks?.success();
494-
console.log('called successs', resultCallbacks);
495482

496483
log('Completed batch transaction with hook', transactionHashes);
497484

@@ -537,7 +524,6 @@ async function processTransactionWithHook(
537524

538525
const { from, networkClientId } = userRequest;
539526

540-
console.log('existingTransaction >>>>', existingTransaction);
541527
if (existingTransaction) {
542528
const { id, onPublish, signedTransaction } = existingTransaction;
543529
const transactionMeta = getTransaction(id);
@@ -556,10 +542,6 @@ async function processTransactionWithHook(
556542
id,
557543
params,
558544
});
559-
console.log('Processed existing transaction with hook', {
560-
id,
561-
params,
562-
});
563545

564546
return {
565547
id,
@@ -642,12 +624,9 @@ async function requestApproval(
642624
* @returns A new TransactionBatchMeta object.
643625
*/
644626
function newBatchMetadata(
645-
transactionBatchMeta: Omit<TransactionBatchMeta, 'time'>,
627+
transactionBatchMeta: TransactionBatchMeta,
646628
): TransactionBatchMeta {
647-
return {
648-
...transactionBatchMeta,
649-
time: Date.now(),
650-
};
629+
return transactionBatchMeta;
651630
}
652631

653632
/**

0 commit comments

Comments
 (0)