Revert "graphql: return error if block from>to (#28393)"

This reverts commit c637c84fc4.
This commit is contained in:
devopsbo3 2023-11-10 12:27:53 -06:00 committed by GitHub
parent 26cd4e60f8
commit cf2f02c1a4

View file

@ -41,8 +41,7 @@ import (
) )
var ( var (
errBlockInvariant = errors.New("block objects must be instantiated with at least one of num or hash") 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")
) )
type Long int64 type Long int64
@ -1334,7 +1333,7 @@ func (r *Resolver) Blocks(ctx context.Context, args struct {
to = rpc.BlockNumber(r.backend.CurrentBlock().Number.Int64()) to = rpc.BlockNumber(r.backend.CurrentBlock().Number.Int64())
} }
if to < from { if to < from {
return nil, errInvalidBlockRange return []*Block{}, nil
} }
var ret []*Block var ret []*Block
for i := from; i <= to; i++ { for i := from; i <= to; i++ {