@@ -498,35 +498,6 @@ class BridgeController extends Controller {
498498 } ,
499499 } ) ;
500500
501- // Create bridge information record before sending the transaction
502- const bridgeRecord : BridgeInformationCreateObject = {
503- from_address : fromAddress ,
504- chain_id : chainId ,
505- amount,
506- created_at : new Date ( ) . toISOString ( ) ,
507- } ;
508-
509- let bridgeRecordId : string | undefined ;
510- try {
511- const createdRecord = await BridgeInformationTable . create ( bridgeRecord ) ;
512- bridgeRecordId = createdRecord . id ;
513- logger . info ( {
514- at : `${ controllerName } #startEvmBridge` ,
515- message : 'Bridge information record created' ,
516- bridgeRecordId,
517- fromAddress,
518- chainId,
519- amount,
520- } ) ;
521- } catch ( error ) {
522- logger . error ( {
523- at : `${ controllerName } #startEvmBridge` ,
524- message : 'Failed to create bridge information record' ,
525- error,
526- } ) ;
527- // Continue with bridge operation even if tracking fails
528- }
529-
530501 // sending the userop to chain via zerodev kernel.
531502 try {
532503 const encoded = await kernelClient . account . encodeCalls ( callData ) ;
@@ -549,28 +520,31 @@ class BridgeController extends Controller {
549520 } ) ;
550521
551522 // Update bridge information record with transaction hash
552- if ( bridgeRecordId ) {
553- try {
554- await BridgeInformationTable . updateTransactionHash (
555- bridgeRecordId ,
556- receipt . transactionHash ,
557- ) ;
558- logger . info ( {
559- at : `${ controllerName } #startEvmBridge` ,
560- message : 'Bridge information record updated with transaction hash' ,
561- bridgeRecordId,
562- transactionHash : receipt . transactionHash ,
563- } ) ;
564- } catch ( error ) {
565- logger . error ( {
566- at : `${ controllerName } #startEvmBridge` ,
567- message : 'Failed to update bridge information record with transaction hash' ,
568- bridgeRecordId,
569- transactionHash : receipt . transactionHash ,
570- error,
571- } ) ;
572- // Don't throw error here as the bridge operation was successful
573- }
523+ try {
524+ // Create bridge information record before sending the transaction
525+ const bridgeRecord : BridgeInformationCreateObject = {
526+ from_address : fromAddress ,
527+ chain_id : chainId ,
528+ amount,
529+ transaction_hash : receipt . transactionHash ,
530+ created_at : new Date ( ) . toISOString ( ) ,
531+ } ;
532+ await BridgeInformationTable . create (
533+ bridgeRecord ,
534+ ) ;
535+ logger . info ( {
536+ at : `${ controllerName } #startEvmBridge` ,
537+ message : 'Bridge information record created' ,
538+ transactionHash : receipt . transactionHash ,
539+ } ) ;
540+ } catch ( error ) {
541+ logger . error ( {
542+ at : `${ controllerName } #startEvmBridge` ,
543+ message : 'Failed to create bridge information record' ,
544+ transactionHash : receipt . transactionHash ,
545+ error,
546+ } ) ;
547+ // Don't throw error here as the bridge operation was successful
574548 }
575549 } catch ( error ) {
576550 logger . error ( {
0 commit comments