eth/filters: reuse error msg for invalid block range (#28479)

pull/28161/merge
ucwong 12 months ago committed by GitHub
parent 6489a0dd1f
commit e9f59b5d5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      eth/filters/filter.go
  2. 2
      eth/filters/filter_test.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

@ -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())

Loading…
Cancel
Save