Trying to check an address for successful transactions. However it seems to raise an "Invalid Etherscan Request" Exception when there are no results, which I don't understand why. It should just return an empty result as this forces unnecessary error handling in a project using this package.
What I Did
from etherscan_py import etherscan_py
client = etherscan_py.Client("API_KEY")
address_to_get_tx = <some address that isn't very active>
from_block = <arbitrary block number here>
to_block = 'latest'
transactions = client.get_all_transactions(
from_address=address_to_get_tx,
status=1,
from_block=from_block,
to_block=to_block,
thread_count=1
)
Changing line 84 from this:
raise Exception("Invalid Etherscan request")
To this:
return res['result']
Fixes the issues as down in line 238 you seem to already have a loop that handles situations when no new transactions are found. I can make a pull request if needed.
Description
Trying to check an address for successful transactions. However it seems to raise an "Invalid Etherscan Request" Exception when there are no results, which I don't understand why. It should just return an empty result as this forces unnecessary error handling in a project using this package.
What I Did
Changing line 84 from this:
raise Exception("Invalid Etherscan request")
To this:
return res['result']
Fixes the issues as down in line 238 you seem to already have a loop that handles situations when no new transactions are found. I can make a pull request if needed.