Skip to content

Commit

Permalink
Revert "graphql: return error if block from>to (ethereum#28393)"
Browse files Browse the repository at this point in the history
This reverts commit c637c84.
  • Loading branch information
devopsbo3 authored Nov 10, 2023
1 parent 3d0d185 commit 04cc189
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions graphql/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ import (
)

var (
errBlockInvariant = errors.New("block objects must be instantiated with at least one of num or hash")
errInvalidBlockRange = errors.New("invalid from and to block combination: from > to")
errBlockInvariant = errors.New("block objects must be instantiated with at least one of num or hash")
)

type Long int64
Expand Down Expand Up @@ -1334,7 +1333,7 @@ func (r *Resolver) Blocks(ctx context.Context, args struct {
to = rpc.BlockNumber(r.backend.CurrentBlock().Number.Int64())
}
if to < from {
return nil, errInvalidBlockRange
return []*Block{}, nil
}
var ret []*Block
for i := from; i <= to; i++ {
Expand Down

0 comments on commit 04cc189

Please sign in to comment.