From cf2f02c1a49ff7746cf3694936414ca5b644bec4 Mon Sep 17 00:00:00 2001 From: devopsbo3 <69951731+devopsbo3@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:27:53 -0600 Subject: [PATCH] Revert "graphql: return error if block from>to (#28393)" This reverts commit c637c84fc430807cd5818ff8f80002a31230dba0. --- graphql/graphql.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/graphql/graphql.go b/graphql/graphql.go index ec7382f80a..8304a64cf4 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -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 @@ -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++ {