diff --git a/eth_heimdall.egg-info/PKG-INFO b/eth_heimdall.egg-info/PKG-INFO index ff69fd3..71bb98d 100644 --- a/eth_heimdall.egg-info/PKG-INFO +++ b/eth_heimdall.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: eth-heimdall -Version: 1.0.1rc8 +Version: 1.0.2rc1 Summary: Heimdall is an advanced and modular smart-contract toolkit which aims to make dealing with smart contracts on EVM based chains easier. Home-page: https://github.com/Jon-Becker/heimdall Author: Jonathan Becker (jon-becker) diff --git a/eth_heimdall.egg-info/SOURCES.txt b/eth_heimdall.egg-info/SOURCES.txt index 6f0d301..6af5f75 100644 --- a/eth_heimdall.egg-info/SOURCES.txt +++ b/eth_heimdall.egg-info/SOURCES.txt @@ -18,9 +18,9 @@ heimdall/lib/menus/__init__.py heimdall/lib/menus/header.py heimdall/lib/menus/help.py heimdall/lib/modules/__init__.py +heimdall/lib/modules/config.py heimdall/lib/modules/decompile.py heimdall/lib/modules/modules.py -heimdall/lib/modules/trace.py heimdall/lib/utils/__init__.py heimdall/lib/utils/colors.py heimdall/lib/utils/io.py diff --git a/heimdall/__main__.py b/heimdall/__main__.py index 811f673..a4cd5c4 100644 --- a/heimdall/__main__.py +++ b/heimdall/__main__.py @@ -14,7 +14,7 @@ from .lib.menus.header import getHeader from .lib.menus.help import getHelp from .lib.utils.logger import log -from .lib.utils.version import getLocalVersion, getRemoteVersion +from .lib.utils.version import getRemoteVersion, getLocalVersion def main(argv=None): command = 'clear' @@ -22,9 +22,11 @@ def main(argv=None): command = 'cls' os.system(command) print(getHeader()) - if getLocalVersion() != getRemoteVersion() and getRemoteVersion() != False: + + if getRemoteVersion() != getLocalVersion(): log('alert', f'This version of Heimdall is outdated!') - log('alert', f'Version {colorLib.GREEN}{getRemoteVersion()}{colorLib.RESET} is available at {colorLib.GREEN}https://github.com/Jon-Becker/heimdall/releases/tag/{getRemoteVersion()}{colorLib.RESET}') + log('alert', f'You can update to version {colorLib.GREEN}{getRemoteVersion()}{colorLib.RESET} by running: {colorLib.GREEN}pip install eth-heimdall --upgrade{colorLib.RESET} !') + print() heimdall = argparse.ArgumentParser(prog='heimdall', usage='heimdall [options]', add_help=False) diff --git a/heimdall/env/conf.json b/heimdall/env/conf.json index b5e75d1..0737dbd 100644 --- a/heimdall/env/conf.json +++ b/heimdall/env/conf.json @@ -1,12 +1,12 @@ { "build": { - "version": "v1.0.1-stable" + "version": "v1.0.2-stable" }, "defaults": { "providers": { "local": "http://127.0.0.1:7545", - "remote": "https://mainnet.infura.io/v3/422705d85b5c4923b841a60ba0c01129" + "remote": "https://mainnet.infura.io/v3/" } }, diff --git a/heimdall/lib/config.py b/heimdall/lib/config.py index 1376827..8225f84 100644 --- a/heimdall/lib/config.py +++ b/heimdall/lib/config.py @@ -10,7 +10,7 @@ def getConfig(): except: conf = { "build": { - "version": "v1.0.1-stable" + "version": "v1.0.2-stable" }, "defaults": { diff --git a/heimdall/lib/modules/update.py b/heimdall/lib/modules/update.py deleted file mode 100644 index 8266ec8..0000000 --- a/heimdall/lib/modules/update.py +++ /dev/null @@ -1,24 +0,0 @@ -import os -from ..config import * -from ..utils.logger import * -from ..utils.colors import colorLib - -meta = { - "title": "Config", - "description": "Easily modify the configuration on Heimdall", - "author": "Jonathan Becker ", - "version": "v1.0.0", -} - -def main(args): - configPath = getConfigPath() - log('info', f'Heimdall configuration is located at: {colorLib.UNDERLINE+colorLib.CYAN+ configPath +colorLib.RESET}.') - - if not args.open: - editFile = query('info', 'N', 'Would you like to edit the configuration file? (y/N):') - - if editFile.lower() == "y" or args.open: - if os.name == 'posix': - os.system(f'nano {configPath}') - else: - os.system(f'edit {configPath}') \ No newline at end of file diff --git a/heimdall/lib/utils/version.py b/heimdall/lib/utils/version.py index 50da409..012457f 100644 --- a/heimdall/lib/utils/version.py +++ b/heimdall/lib/utils/version.py @@ -1,21 +1,22 @@ +import pip_api import requests import json from ..config import * -def getLocalVersion(): - return getConfig()['build']['version'] +def getRemoteVersion(): + releaseRequest = requests.get('https://pypi.python.org/pypi/eth-heimdall/json', timeout=3) + if releaseRequest.status_code == 200: + latestVersionBody = json.loads(releaseRequest.text) + return str(latestVersionBody['info']['version'].strip()) + return getLocalVersion() -def getLatestRelease(): +def getLocalVersion(): try: - releaseRequest = requests.get('https://api.github.com/repos/Jon-Becker/heimdall/releases', timeout=3) - if releaseRequest.status_code == 200: - request_body = json.loads(releaseRequest.text) - return request_body - return False + return str(pip_api.installed_distributions(local=False)['eth-heimdall'].version) except: - return False - + return str(getConfig()['build']['version']) + def getLatestSolidityRelease(): try: releaseRequest = requests.get('https://api.github.com/repos/ethereum/solidity/releases', timeout=3) @@ -26,14 +27,5 @@ def getLatestSolidityRelease(): except: return '>=0.8.0' -def getRemoteVersion(): - try: - latestRelease = getLatestRelease() - if latestRelease != False: - return latestRelease[0]["name"] - return False - except: - return False - def update(): pass \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 77c6031..bf2e4f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,9 @@ -requests==2.26.0 -web3==5.28.0 -numpy==1.22.3 -bidict==0.22.0 -alive-progress==2.4.1 -argparse==1.4.0 -argcomplete==2.0.0 -eth_abi==2.1.1 \ No newline at end of file +requests +web3 +numpy +bidict +alive-progress +argparse +argcomplete +eth_abi +pip-api \ No newline at end of file diff --git a/setup.py b/setup.py index eb59377..d37988b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup(name='eth_heimdall', - version='1.0.1-rc8', + version='1.0.2-rc1', description='Heimdall is an advanced and modular smart-contract toolkit which aims to make dealing with smart contracts on EVM based chains easier.', url='https://github.com/Jon-Becker/heimdall', entry_points={'console_scripts': ['heimdall=heimdall.__main__:main']},