diff --git a/bridge-history-api/internal/logic/history_logic.go b/bridge-history-api/internal/logic/history_logic.go index ee52ce3ac5..466d0ff1c0 100644 --- a/bridge-history-api/internal/logic/history_logic.go +++ b/bridge-history-api/internal/logic/history_logic.go @@ -97,6 +97,11 @@ func (h *HistoryLogic) GetL2UnclaimedWithdrawalsByAddress(ctx context.Context, a return nil, 0, errors.New("unexpected error") } + if len(txHistoryInfos) == 0 { + log.Error("failed to get L2 claimable withdrawals by address len = 0", "address", address) + return nil, 0, errors.New("unexpected error") + } + return h.processAndCacheTxHistoryInfo(ctx, cacheKey, txHistoryInfos, page, pageSize) } diff --git a/bridge-history-api/internal/orm/cross_message.go b/bridge-history-api/internal/orm/cross_message.go index 91d670d8e8..05e6eecfcf 100644 --- a/bridge-history-api/internal/orm/cross_message.go +++ b/bridge-history-api/internal/orm/cross_message.go @@ -157,7 +157,7 @@ func (c *CrossMessage) GetL2UnclaimedWithdrawalsByAddress(ctx context.Context, s db = db.Where("tx_status in (?)", []types.TxStatusType{types.TxStatusTypeSent, types.TxStatusTypeFailedRelayed, types.TxStatusTypeRelayTxReverted}) db = db.Where("sender = ?", sender) db = db.Order("block_timestamp desc") - db = db.Limit(500) + db = db.Limit(10000) if err := db.Find(&messages).Error; err != nil { return nil, fmt.Errorf("failed to get L2 claimable withdrawal messages by sender address, sender: %v, error: %w", sender, err) }