Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bridge-history-api/internal/logic/event_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"scroll-tech/bridge-history-api/internal/utils"
)

// EventUpdateLogic the logic of insert/update the database
// EventUpdateLogic contains logic for inserting and updating database records.
type EventUpdateLogic struct {
db *gorm.DB
crossMessageOrm *orm.CrossMessage
Expand All @@ -26,7 +26,7 @@ type EventUpdateLogic struct {
eventUpdateLogicL2MessageNonceUpdateHeight prometheus.Gauge
}

// NewEventUpdateLogic creates a EventUpdateLogic instance
// NewEventUpdateLogic creates a new EventUpdateLogic instance.
func NewEventUpdateLogic(db *gorm.DB, isL1 bool) *EventUpdateLogic {
b := &EventUpdateLogic{
db: db,
Expand All @@ -50,7 +50,7 @@ func NewEventUpdateLogic(db *gorm.DB, isL1 bool) *EventUpdateLogic {
return b
}

// GetL1SyncHeight gets the l1 sync height from db
// GetL1SyncHeight returns L1 sync heights from the database.
func (b *EventUpdateLogic) GetL1SyncHeight(ctx context.Context) (uint64, uint64, uint64, error) {
messageSyncedHeight, err := b.crossMessageOrm.GetMessageSyncedHeightInDB(ctx, btypes.MessageTypeL1SentMessage)
if err != nil {
Expand Down Expand Up @@ -219,7 +219,7 @@ func (b *EventUpdateLogic) UpdateL2WithdrawMessageProofs(ctx context.Context, he
return nil
}

// UpdateL2BridgeBatchDepositEvent update l2 bridge batch deposit status
// UpdateL2BridgeBatchDepositEvent updates the status of L2 bridge batch deposit events.
func (b *EventUpdateLogic) UpdateL2BridgeBatchDepositEvent(ctx context.Context, l2BatchDistributes []*orm.BridgeBatchDepositEvent) error {
distributeFailedMap := make(map[uint64][]string)
for _, l2BatchDistribute := range l2BatchDistributes {
Expand Down