Skip to content

Commit

Permalink
chore: ignore validators without score
Browse files Browse the repository at this point in the history
  • Loading branch information
onmax committed Nov 18, 2024
1 parent c37f65b commit 7867997
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/utils/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ export async function fetchValidators(params: FetchValidatorsOptions): Result<Fe
if (withScores) {
consola.info(`Fetching validators with scores for epoch ${epochNumber}`)
query = query
.leftJoin(tables.scores, eq(tables.validators.id, tables.scores.validatorId))
.leftJoin(tables.scores, and(
isNotNull(tables.scores.total),
eq(tables.validators.id, tables.scores.validatorId),
))
}
query.leftJoin(tables.activity, and(eq(tables.validators.id, tables.activity.validatorId), eq(tables.activity.epochNumber, epochNumber)))

Expand Down

0 comments on commit 7867997

Please sign in to comment.