diff --git a/README.rst b/README.rst index bb839a5..b42a1c7 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ ============================== -Welcome to ScanWatch 0.1.2 +Welcome to ScanWatch 0.1.3 ============================== Note @@ -18,6 +18,13 @@ This library is a local tracker of transactions for the Ethereum chain and the B It is a simple interface with the `etherscan `_ and the `bscscan `_ APIs and will save locally the results to gain time and avoid over-calling the APIs. +Announcement +------------ + +If you previously used this library with a version inferior to 0.1.3, +please head `here `_ to correct a potential bug in the database. + + Quick Tour ---------- @@ -44,7 +51,7 @@ Example for Ethereum: .. code:: python - from ScanWatch import ScanManager + from ScanWatch.ScanManager import ScanManager from ScanWatch.utils.enums import NETWORK api_token = "" @@ -56,7 +63,7 @@ Example for BSC: .. code:: python - from ScanWatch import ScanManager + from ScanWatch.ScanManager import ScanManager from ScanWatch.utils.enums import NETWORK api_token = "" diff --git a/ScanWatch/__init__.py b/ScanWatch/__init__.py index b828470..70f87e3 100644 --- a/ScanWatch/__init__.py +++ b/ScanWatch/__init__.py @@ -1,4 +1,2 @@ __author__ = 'EtWnn' -__version__ = '0.1.2' - -from ScanWatch.ScanManager import ScanManager +__version__ = '0.1.3' diff --git a/ScanWatch/storage/ScanDataBase.py b/ScanWatch/storage/ScanDataBase.py index b3f22d5..a8fca12 100644 --- a/ScanWatch/storage/ScanDataBase.py +++ b/ScanWatch/storage/ScanDataBase.py @@ -78,16 +78,13 @@ def get_last_block_number(self, address: str, nt_type: NETWORK, net: str, tr_typ :rtype: int """ table = get_transaction_table(address, nt_type, net, tr_type) - selection = f"MAX({table.blockNumber})" - result = self.get_conditions_rows(table, selection=selection) + selection = str(table.blockNumber) + query = self.get_conditions_rows(table, selection=selection) default = 0 try: - result = result[0][0] - except IndexError: + return max([int(e[0]) for e in query]) + except ValueError: return default - if result is None: - return default - return int(result) diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..9f8a77a --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,4 @@ +setuptools~=58.0.4 +sphinx~=4.3.2 +sphinx_rtd_theme~=1.0.0 +twine~=3.7.1 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 2802d1d..ce936c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,3 @@ -requests -appdirs -tqdm -sphinx -sphinx_rtd_theme -twine \ No newline at end of file +appdirs~=1.4.4 +requests~=2.26.0 +tqdm~=4.62.3 \ No newline at end of file diff --git a/setup.py b/setup.py index 260ba2b..fec7799 100644 --- a/setup.py +++ b/setup.py @@ -10,18 +10,22 @@ with open(os.path.join(this_directory, 'ScanWatch/__init__.py'), encoding='utf-8') as f: exec(f.read(), about) +with open("requirements.txt") as file: + requirements_content = file.read() +requirements = requirements_content.split('\n') + setup( name='ScanWatch', version=about['__version__'], packages=['ScanWatch', 'ScanWatch.storage', 'ScanWatch.utils'], url='https://github.com/EtWnn/ScanWatch', author='EtWnn', - author_email='', + author_email='EtWnn0x@gmail.com', license='MIT', description='Local tracker of an eth address for ETH and BSC scan', long_description=long_description, long_description_content_type='text/x-rst', - install_requires=['requests', 'appdirs', 'tqdm'], + install_requires=requirements, keywords='eth bsc wallet save tracking history ethereum tracker binance smartchain smart chain', classifiers=[ 'Intended Audience :: Developers',