@@ -15,7 +15,7 @@ import (
1515 "scroll-tech/bridge-history-api/internal/utils"
1616)
1717
18- // EventUpdateLogic the logic of insert/update the database
18+ // EventUpdateLogic contains logic for inserting and updating database records.
1919type EventUpdateLogic struct {
2020 db * gorm.DB
2121 crossMessageOrm * orm.CrossMessage
@@ -26,7 +26,7 @@ type EventUpdateLogic struct {
2626 eventUpdateLogicL2MessageNonceUpdateHeight prometheus.Gauge
2727}
2828
29- // NewEventUpdateLogic creates a EventUpdateLogic instance
29+ // NewEventUpdateLogic creates a new EventUpdateLogic instance.
3030func NewEventUpdateLogic (db * gorm.DB , isL1 bool ) * EventUpdateLogic {
3131 b := & EventUpdateLogic {
3232 db : db ,
@@ -50,7 +50,7 @@ func NewEventUpdateLogic(db *gorm.DB, isL1 bool) *EventUpdateLogic {
5050 return b
5151}
5252
53- // GetL1SyncHeight gets the l1 sync height from db
53+ // GetL1SyncHeight returns the L1 sync height from the database.
5454func (b * EventUpdateLogic ) GetL1SyncHeight (ctx context.Context ) (uint64 , uint64 , uint64 , error ) {
5555 messageSyncedHeight , err := b .crossMessageOrm .GetMessageSyncedHeightInDB (ctx , btypes .MessageTypeL1SentMessage )
5656 if err != nil {
@@ -219,7 +219,7 @@ func (b *EventUpdateLogic) UpdateL2WithdrawMessageProofs(ctx context.Context, he
219219 return nil
220220}
221221
222- // UpdateL2BridgeBatchDepositEvent update l2 bridge batch deposit status
222+ // UpdateL2BridgeBatchDepositEvent updates the status of L2 bridge batch deposit events.
223223func (b * EventUpdateLogic ) UpdateL2BridgeBatchDepositEvent (ctx context.Context , l2BatchDistributes []* orm.BridgeBatchDepositEvent ) error {
224224 distributeFailedMap := make (map [uint64 ][]string )
225225 for _ , l2BatchDistribute := range l2BatchDistributes {
0 commit comments