cmd/workload: fix diagnostics

This commit is contained in:
Felix Lange 2025-02-25 12:41:57 +01:00
parent 33ec53c417
commit c35849552c

View file

@ -180,10 +180,7 @@ func (s *filterTestGen) extendRange(q *filterQuery) *filterQuery {
if rangeLen+extLen > s.finalizedBlock {
return nil
}
extBefore := rand.Int63n(extLen + 1)
if extBefore > q.FromBlock {
extBefore = q.FromBlock
}
extBefore := min(rand.Int63n(extLen+1), q.FromBlock)
extAfter := extLen - extBefore
if q.ToBlock+extAfter > s.finalizedBlock {
d := q.ToBlock + extAfter - s.finalizedBlock
@ -337,7 +334,7 @@ func (s *filterTestGen) newNarrowedQuery() *filterQuery {
pick--
}
}
panic(nil)
panic("unreachable")
}
// randomQuery returns a random query from the ones that were already generated.