feat: fix l2 update error

This commit is contained in:
georgehao
2024-05-06 16:39:29 +08:00
parent 4b2c567dce
commit 2bfaf904b9
2 changed files with 3 additions and 2 deletions

View File

@@ -196,8 +196,8 @@ func (b *EventUpdateLogic) UpdateL1BatchIndexAndStatus(ctx context.Context, heig
return nil
}
// UpdateL1BridgeBatchDepositEvent update l1 bridge batch deposit status
func (b *EventUpdateLogic) UpdateL1BridgeBatchDepositEvent(ctx context.Context, l2BatchDistributes []*orm.BridgeBatchDepositEvent) error {
// UpdateL2BridgeBatchDepositEvent update l2 bridge batch deposit status
func (b *EventUpdateLogic) UpdateL2BridgeBatchDepositEvent(ctx context.Context, l2BatchDistributes []*orm.BridgeBatchDepositEvent) error {
batchIndexMap := make(map[uint64]*orm.BridgeBatchDepositEvent)
distributeFailedMap := make(map[uint64][]string)
for _, l2BatchDistribute := range l2BatchDistributes {

View File

@@ -135,6 +135,7 @@ func (c *BridgeBatchDepositEvent) UpdateBatchEventStatus(ctx context.Context, di
db := c.db.WithContext(ctx)
db = db.Model(&BridgeBatchDepositEvent{})
db = db.Where("batch_index = ?", distributeMessage.BatchIndex)
db = db.Where("token_type = ?", distributeMessage.TokenType)
updateFields := map[string]interface{}{
"l2_token_address": distributeMessage.L2TokenAddress,
"l2_block_number": distributeMessage.L2BlockNumber,