Skip to content

Commit e9f59b5

Browse files
authored
eth/filters: reuse error msg for invalid block range (#28479)
1 parent 6489a0d commit e9f59b5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

eth/filters/filter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (f *Filter) Logs(ctx context.Context) ([]*types.Log, error) {
114114

115115
// special case for pending logs
116116
if beginPending && !endPending {
117-
return nil, errors.New("invalid block range")
117+
return nil, errInvalidBlockRange
118118
}
119119

120120
// Short-cut if all we care about is pending logs

eth/filters/filter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ func TestFilters(t *testing.T) {
353353
},
354354
{
355355
f: sys.NewRangeFilter(int64(rpc.PendingBlockNumber), int64(rpc.LatestBlockNumber), nil, nil),
356-
err: "invalid block range",
356+
err: errInvalidBlockRange.Error(),
357357
},
358358
} {
359359
logs, err := tc.f.Logs(context.Background())

0 commit comments

Comments
 (0)