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

This commit is contained in:
ucwong 2023-11-21 14:28:44 +00:00 committed by GitHub
parent 6489a0dd1f
commit e9f59b5d5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

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

View File

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