Skip to content

Commit

Permalink
fix: query failure_reason = ""
Browse files Browse the repository at this point in the history
  • Loading branch information
bendanzhentan committed Dec 6, 2023
1 parent a497931 commit e31ae56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/bot/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func ProcessUnprovenBotDelegatedWithdrawals(ctx context.Context, log log.Logger,
maxBlockTime := time.Now().Unix() - cfg.ProposeTimeWindow

unprovens := make([]core.L2ContractEvent, 0)
result := db.Order("id asc").Where("proven = false AND block_time < ? AND failure_reason IS NULL", maxBlockTime).Limit(limit).Find(&unprovens)
result := db.Order("id asc").Where("proven = false AND block_time < ? AND failure_reason = ''", maxBlockTime).Limit(limit).Find(&unprovens)
if result.Error != nil {
log.Error("failed to query l2_contract_events", "error", result.Error)
return
Expand Down Expand Up @@ -155,7 +155,7 @@ func ProcessUnfinalizedBotDelegatedWithdrawals(ctx context.Context, log log.Logg
maxBlockTime := time.Now().Unix() - cfg.ChallengeTimeWindow

unfinalizeds := make([]core.L2ContractEvent, 0)
result := db.Order("block_time asc").Where("proven = true AND finalized = false AND block_time < ? AND failure_reason IS NULL", maxBlockTime).Limit(limit).Find(&unfinalizeds)
result := db.Order("block_time asc").Where("proven = true AND finalized = false AND block_time < ? AND failure_reason = ''", maxBlockTime).Limit(limit).Find(&unfinalizeds)
if result.Error != nil {
log.Error("failed to query l2_contract_events", "error", result.Error)
return
Expand Down

0 comments on commit e31ae56

Please sign in to comment.