@@ -411,7 +411,6 @@ async function addTransactionBatchWithHook(
411
411
const transactionCount = nestedTransactions . length ;
412
412
const collectHook = new CollectPublishHook ( transactionCount ) ;
413
413
try {
414
- console . log ( 'Collecting publish hook >>>>' , requireApproval , useHook ) ;
415
414
if ( requireApproval && useHook ) {
416
415
const { gasLimit, transactions : transactionsWithGas } =
417
416
await simulateGasBatch ( {
@@ -423,7 +422,6 @@ async function addTransactionBatchWithHook(
423
422
// resigned the transactions with simulated gas
424
423
nestedTransactions = transactionsWithGas ;
425
424
426
- console . log ( 'transactions simulated >>>>' , transactionsWithGas ) ;
427
425
const txBatchMeta = newBatchMetadata ( {
428
426
id : batchId ,
429
427
chainId,
@@ -433,18 +431,16 @@ async function addTransactionBatchWithHook(
433
431
from,
434
432
gas : gasLimit ,
435
433
} ) ;
436
- console . log ( '1 txBatchMeta >>>>' , txBatchMeta ?. transactions ?. [ 0 ] ) ;
437
434
addBatchMetadata ( txBatchMeta , update ) ;
438
435
439
436
resultCallbacks = ( await requestApproval ( txBatchMeta , messenger ) )
440
437
. resultCallbacks ;
441
- console . log ( 'resultCallbacks >>>>' , resultCallbacks ) ;
442
438
}
443
439
444
440
const publishHook = collectHook . getHook ( ) ;
445
441
const hookTransactions : Omit < PublishBatchHookTransaction , 'signedTx' > [ ] =
446
442
[ ] ;
447
- console . log ( '1 >>>>' , nestedTransactions ) ;
443
+
448
444
for ( const nestedTransaction of nestedTransactions ) {
449
445
const hookTransaction = await processTransactionWithHook (
450
446
batchId ,
@@ -455,22 +451,15 @@ async function addTransactionBatchWithHook(
455
451
456
452
hookTransactions . push ( hookTransaction ) ;
457
453
}
458
- console . log ( '1.5 >>>>' ) ;
459
454
460
455
const { signedTransactions } = await collectHook . ready ( ) ;
461
- console . log ( '2 signedTransactions >>>>' , signedTransactions ) ;
462
456
463
457
const transactions = hookTransactions . map ( ( transaction , index ) => ( {
464
458
...transaction ,
465
459
signedTx : signedTransactions [ index ] ,
466
460
} ) ) ;
467
461
468
462
log ( 'Calling publish batch hook' , { from, networkClientId, transactions } ) ;
469
- console . log ( 'Calling publish batch hook' , {
470
- from,
471
- networkClientId,
472
- transactions,
473
- } ) ;
474
463
475
464
const result = await publishBatchHook ( {
476
465
from,
@@ -479,7 +468,6 @@ async function addTransactionBatchWithHook(
479
468
} ) ;
480
469
481
470
log ( 'Publish batch hook result' , result ) ;
482
- console . log ( 'Publish batch hook result' , result ) ;
483
471
484
472
if ( ! result ) {
485
473
throw new Error ( 'Publish batch hook did not return a result' ) ;
@@ -491,7 +479,6 @@ async function addTransactionBatchWithHook(
491
479
492
480
collectHook . success ( transactionHashes ) ;
493
481
resultCallbacks ?. success ( ) ;
494
- console . log ( 'called successs' , resultCallbacks ) ;
495
482
496
483
log ( 'Completed batch transaction with hook' , transactionHashes ) ;
497
484
@@ -537,7 +524,6 @@ async function processTransactionWithHook(
537
524
538
525
const { from, networkClientId } = userRequest ;
539
526
540
- console . log ( 'existingTransaction >>>>' , existingTransaction ) ;
541
527
if ( existingTransaction ) {
542
528
const { id, onPublish, signedTransaction } = existingTransaction ;
543
529
const transactionMeta = getTransaction ( id ) ;
@@ -556,10 +542,6 @@ async function processTransactionWithHook(
556
542
id,
557
543
params,
558
544
} ) ;
559
- console . log ( 'Processed existing transaction with hook' , {
560
- id,
561
- params,
562
- } ) ;
563
545
564
546
return {
565
547
id,
@@ -642,12 +624,9 @@ async function requestApproval(
642
624
* @returns A new TransactionBatchMeta object.
643
625
*/
644
626
function newBatchMetadata (
645
- transactionBatchMeta : Omit < TransactionBatchMeta , 'time' > ,
627
+ transactionBatchMeta : TransactionBatchMeta ,
646
628
) : TransactionBatchMeta {
647
- return {
648
- ...transactionBatchMeta ,
649
- time : Date . now ( ) ,
650
- } ;
629
+ return transactionBatchMeta ;
651
630
}
652
631
653
632
/**
0 commit comments