From 3e5f8c4373d928530e9b8694a4dac496db9079d1 Mon Sep 17 00:00:00 2001 From: zhangkai Date: Mon, 12 Aug 2024 11:22:13 +0800 Subject: [PATCH] GetFilterChanges return a empty object instead of null when no changes. (#242) * if no blocks return object instead of null * fix compile error * logs return object instead of null * return object install null --- jsonrpc/endpoints_eth.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jsonrpc/endpoints_eth.go b/jsonrpc/endpoints_eth.go index ca03f7b194..3fe3c373c9 100644 --- a/jsonrpc/endpoints_eth.go +++ b/jsonrpc/endpoints_eth.go @@ -473,7 +473,7 @@ func (e *EthEndpoints) GetFilterChanges(filterID string) (interface{}, types.Err return nil, rpcErr } if len(res) == 0 { - return nil, nil + return []common.Hash{}, nil } return res, nil } @@ -488,7 +488,7 @@ func (e *EthEndpoints) GetFilterChanges(filterID string) (interface{}, types.Err return nil, rpcErr } if len(res) == 0 { - return nil, nil + return []common.Hash{}, nil } return res, nil } @@ -511,7 +511,7 @@ func (e *EthEndpoints) GetFilterChanges(filterID string) (interface{}, types.Err } res := resInterface.([]types.Log) if len(res) == 0 { - return nil, nil + return []types.Log{}, nil } return res, nil }