From 5bdd02c62e41732a7ccf9ce38c92cc094e085b22 Mon Sep 17 00:00:00 2001 From: zhangkai Date: Wed, 7 Aug 2024 22:10:36 +0800 Subject: [PATCH 1/4] if no blocks return object instead of null --- jsonrpc/endpoints_eth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonrpc/endpoints_eth.go b/jsonrpc/endpoints_eth.go index ca03f7b194..6e7c24415e 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 } From 470870c62d026b655cb222efa43be147c8265738 Mon Sep 17 00:00:00 2001 From: zhangkai Date: Wed, 7 Aug 2024 22:31:15 +0800 Subject: [PATCH 2/4] fix compile error --- jsonrpc/endpoints_eth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonrpc/endpoints_eth.go b/jsonrpc/endpoints_eth.go index 6e7c24415e..dedcc21af4 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 []common.Hash, nil + return []common.Hash{}, nil } return res, nil } From 6e4b8e16bfd74fc1938f72c1a57ad4058026e207 Mon Sep 17 00:00:00 2001 From: zhangkai Date: Sun, 11 Aug 2024 16:42:03 +0800 Subject: [PATCH 3/4] logs return object instead of null --- jsonrpc/endpoints_eth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonrpc/endpoints_eth.go b/jsonrpc/endpoints_eth.go index dedcc21af4..6a9afffc58 100644 --- a/jsonrpc/endpoints_eth.go +++ b/jsonrpc/endpoints_eth.go @@ -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 } From 165609ed760b43da428c30a7fae725e0c509323a Mon Sep 17 00:00:00 2001 From: zhangkai Date: Sun, 11 Aug 2024 16:54:42 +0800 Subject: [PATCH 4/4] return object install null --- jsonrpc/endpoints_eth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonrpc/endpoints_eth.go b/jsonrpc/endpoints_eth.go index 6a9afffc58..3fe3c373c9 100644 --- a/jsonrpc/endpoints_eth.go +++ b/jsonrpc/endpoints_eth.go @@ -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 }