diff --git a/eth/filters/filter.go b/eth/filters/filter.go index a5750c193..83e3284a2 100644 --- a/eth/filters/filter.go +++ b/eth/filters/filter.go @@ -114,7 +114,7 @@ func (f *Filter) Logs(ctx context.Context) ([]*types.Log, error) { // special case for pending logs if beginPending && !endPending { - return nil, errors.New("invalid block range") + return nil, errInvalidBlockRange } // Short-cut if all we care about is pending logs diff --git a/eth/filters/filter_test.go b/eth/filters/filter_test.go index 4e09a9038..1db917c96 100644 --- a/eth/filters/filter_test.go +++ b/eth/filters/filter_test.go @@ -353,7 +353,7 @@ func TestFilters(t *testing.T) { }, { f: sys.NewRangeFilter(int64(rpc.PendingBlockNumber), int64(rpc.LatestBlockNumber), nil, nil), - err: "invalid block range", + err: errInvalidBlockRange.Error(), }, } { logs, err := tc.f.Logs(context.Background())