graphql: logs return error if from block > to (#28412)

As per discussion in ethereum/execution-apis#475

Signed-off-by: jsvisa <delweng@gmail.com>
pull/28418/head
Delweng 1 year ago committed by GitHub
parent 96b75033c0
commit f7b62e5506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      graphql/graphql.go

@ -1417,6 +1417,9 @@ func (r *Resolver) Logs(ctx context.Context, args struct{ Filter FilterCriteria
if args.Filter.ToBlock != nil { if args.Filter.ToBlock != nil {
end = int64(*args.Filter.ToBlock) end = int64(*args.Filter.ToBlock)
} }
if begin > 0 && end > 0 && begin > end {
return nil, errInvalidBlockRange
}
var addresses []common.Address var addresses []common.Address
if args.Filter.Addresses != nil { if args.Filter.Addresses != nil {
addresses = *args.Filter.Addresses addresses = *args.Filter.Addresses

Loading…
Cancel
Save