We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e90266a commit c637c84Copy full SHA for c637c84
graphql/graphql.go
@@ -41,7 +41,8 @@ import (
41
)
42
43
var (
44
- 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")
45
+ errInvalidBlockRange = errors.New("invalid from and to block combination: from > to")
46
47
48
type Long int64
@@ -1333,7 +1334,7 @@ func (r *Resolver) Blocks(ctx context.Context, args struct {
1333
1334
to = rpc.BlockNumber(r.backend.CurrentBlock().Number.Int64())
1335
}
1336
if to < from {
- return []*Block{}, nil
1337
+ return nil, errInvalidBlockRange
1338
1339
var ret []*Block
1340
for i := from; i <= to; i++ {
0 commit comments