Skip to content

Commit

Permalink
change eth_getFilterLogs return from nil to empty logs (#217)
Browse files Browse the repository at this point in the history
* change eth_getFilterLogs return from nil to empty logs

* remove go code style on import
  • Loading branch information
bylingo authored Jun 13, 2024
1 parent 9794745 commit 71dc503
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jsonrpc/endpoints_eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,13 +537,13 @@ func (e *EthEndpoints) GetFilterChanges(filterID string) (interface{}, types.Err
func (e *EthEndpoints) GetFilterLogs(filterID string) (interface{}, types.Error) {
filter, err := e.storage.GetFilter(filterID)
if errors.Is(err, ErrNotFound) {
return nil, nil
return []types.Log{}, nil
} else if err != nil {
return RPCErrorResponse(types.DefaultErrorCode, "failed to get filter from storage", err, true)
}

if filter.Type != FilterTypeLog {
return nil, nil
return []types.Log{}, nil
}

filterParameters := filter.Parameters.(LogFilter)
Expand Down

0 comments on commit 71dc503

Please sign in to comment.