Skip to content

Commit f04949e

Browse files
jsvisacolinlyguo
authored andcommitted
graphql: logs return error if from block > to (ethereum#28412)
As per discussion in ethereum/execution-apis#475 Signed-off-by: jsvisa <[email protected]>
1 parent eb2a3de commit f04949e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

graphql/graphql.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,9 @@ func (r *Resolver) Logs(ctx context.Context, args struct{ Filter FilterCriteria
14271427
if args.Filter.ToBlock != nil {
14281428
end = int64(*args.Filter.ToBlock)
14291429
}
1430+
if begin > 0 && end > 0 && begin > end {
1431+
return nil, errInvalidBlockRange
1432+
}
14301433
var addresses []common.Address
14311434
if args.Filter.Addresses != nil {
14321435
addresses = *args.Filter.Addresses

0 commit comments

Comments
 (0)