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

This commit is contained in:
ucwong
2023-11-21 15:28:44 +01:00
committed by GitHub
parent 6489a0dd1f
commit e9f59b5d5e
2 changed files with 2 additions and 2 deletions
+1 -1
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
+1 -1
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())