Skip to content

Commit

Permalink
eth/filters: reuse error msg for invalid block range (#28479)
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong authored Nov 21, 2023
1 parent 6489a0d commit e9f59b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eth/filters/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eth/filters/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit e9f59b5

Please sign in to comment.