From 13859db98b926fd6293f1fb71fa4a39e7d6cee22 Mon Sep 17 00:00:00 2001 From: keywolf Date: Sun, 19 May 2019 15:23:21 +0800 Subject: [PATCH 1/2] minor fix --- etherscan/accounts.py | 5 ++++- etherscan/client.py | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/etherscan/accounts.py b/etherscan/accounts.py index 2bf7177..8552479 100755 --- a/etherscan/accounts.py +++ b/etherscan/accounts.py @@ -72,7 +72,10 @@ def get_transaction_page(self, page=1, offset=10000, sort='asc', self.url_dict[self.OFFSET] = str(offset) self.url_dict[self.SORT] = sort self.build_url() - req = self.connect() + try: + req = self.connect() + except EmptyResponse: + req = {'result': []} return req['result'] def get_all_transactions(self, offset=10000, sort='asc', diff --git a/etherscan/client.py b/etherscan/client.py index 0802433..ab03857 100755 --- a/etherscan/client.py +++ b/etherscan/client.py @@ -116,11 +116,11 @@ def connect(self): # Check for empty response if req.text: data = req.json() - status = data.get('status') - if status == '1' or self.check_keys_api(data): - return data - else: - raise EmptyResponse(data.get('message', 'no message')) + # status = data.get('status') + # if status == '1' or self.check_keys_api(data): + return data + else: + raise EmptyResponse('no message') raise BadRequest( "Problem with connection, status code: %s" % req.status_code) From 81989e91b90a2465b7df89d0b79058feeeea8505 Mon Sep 17 00:00:00 2001 From: keywolf Date: Sun, 19 May 2019 15:24:48 +0800 Subject: [PATCH 2/2] minor fix --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d53fd3d..bf5988a 100755 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ with `YourApiKeyToken` is your provided API key token from EtherScan.io To install the package to your computer, simply run the following command in the base directory: python3 -m pip install py-etherscan-api + python3 setup.py install --prefix=/usr/local ## Available bindings