Skip to content

Commit 15a2347

Browse files
georgehaoThegaram
andauthored
fix bridge history GetL2UnclaimedWithdrawalsByAddress (#1760)
Co-authored-by: Péter Garamvölgyi <[email protected]>
1 parent 9100a0b commit 15a2347

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

bridge-history-api/internal/logic/history_logic.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ func (h *HistoryLogic) GetL2UnclaimedWithdrawalsByAddress(ctx context.Context, a
9797
return nil, 0, errors.New("unexpected error")
9898
}
9999

100+
if len(txHistoryInfos) == 0 {
101+
log.Error("failed to get L2 claimable withdrawals by address len = 0", "address", address)
102+
return nil, 0, errors.New("unexpected error")
103+
}
104+
100105
return h.processAndCacheTxHistoryInfo(ctx, cacheKey, txHistoryInfos, page, pageSize)
101106
}
102107

bridge-history-api/internal/orm/cross_message.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (c *CrossMessage) GetL2UnclaimedWithdrawalsByAddress(ctx context.Context, s
157157
db = db.Where("tx_status in (?)", []types.TxStatusType{types.TxStatusTypeSent, types.TxStatusTypeFailedRelayed, types.TxStatusTypeRelayTxReverted})
158158
db = db.Where("sender = ?", sender)
159159
db = db.Order("block_timestamp desc")
160-
db = db.Limit(500)
160+
db = db.Limit(10000)
161161
if err := db.Find(&messages).Error; err != nil {
162162
return nil, fmt.Errorf("failed to get L2 claimable withdrawal messages by sender address, sender: %v, error: %w", sender, err)
163163
}

0 commit comments

Comments
 (0)