Skip to content

Commit

Permalink
graphql: logs return error if from block > to (#28412)
Browse files Browse the repository at this point in the history
As per discussion in ethereum/execution-apis#475

Signed-off-by: jsvisa <delweng@gmail.com>
  • Loading branch information
jsvisa authored Oct 25, 2023
1 parent 96b7503 commit f7b62e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions graphql/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,9 @@ func (r *Resolver) Logs(ctx context.Context, args struct{ Filter FilterCriteria
if args.Filter.ToBlock != nil {
end = int64(*args.Filter.ToBlock)
}
if begin > 0 && end > 0 && begin > end {
return nil, errInvalidBlockRange
}
var addresses []common.Address
if args.Filter.Addresses != nil {
addresses = *args.Filter.Addresses
Expand Down

0 comments on commit f7b62e5

Please sign in to comment.