From de739dca198a247fa55b85aa0f6d39cc56c84f17 Mon Sep 17 00:00:00 2001 From: wang shuai <365089264@qq.com> Date: Thu, 18 Nov 2021 16:13:13 +0800 Subject: [PATCH 1/2] fixbug --- logs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logs.go b/logs.go index b674041..e9293fe 100644 --- a/logs.go +++ b/logs.go @@ -2,7 +2,7 @@ package etherscan // GetLogs gets a list of log for a single address // startBlock and endBlock cann`t be nil -func (c *Client) GetLogs(address string, fromBlock string, toBlock string, topic0 string) (logs []Log, err error) { +func (c *Client) GetLogs(address *string, fromBlock string, toBlock string, topic0 string) (logs []Log, err error) { param := M{ "fromBlock": fromBlock, "toBlock": toBlock, From 20ae28d6ce923d08f9e469e308c127c7c751bce6 Mon Sep 17 00:00:00 2001 From: wang shuai <365089264@qq.com> Date: Thu, 18 Nov 2021 18:48:02 +0800 Subject: [PATCH 2/2] fixbug No records found --- client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client.go b/client.go index e69679a..b1a7b08 100644 --- a/client.go +++ b/client.go @@ -172,6 +172,9 @@ func (c *Client) call(module, action string, param map[string]interface{}, outco err = wrapErr(err, "json unmarshal envelope") return } + if envelope.Status == 0 && envelope.Message == "No records found" { + return + } if envelope.Status != 1 { err = fmt.Errorf("etherscan server: %s", envelope.Message) return