From 0b993bcb099b327e0a07d6776d75c621c72bc418 Mon Sep 17 00:00:00 2001 From: bylingo <790653865@qq.com> Date: Wed, 5 Jun 2024 15:19:02 +0800 Subject: [PATCH] change eth_getFilterLogs return from nil to empty logs --- jsonrpc/endpoints_eth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonrpc/endpoints_eth.go b/jsonrpc/endpoints_eth.go index 22fee88874..c32cc5300b 100644 --- a/jsonrpc/endpoints_eth.go +++ b/jsonrpc/endpoints_eth.go @@ -490,13 +490,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)