Skip to content

Commit

Permalink
Version fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Becker committed May 21, 2022
1 parent 454fb9b commit 2239a47
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 60 deletions.
2 changes: 1 addition & 1 deletion eth_heimdall.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion eth_heimdall.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions heimdall/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@
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'
if os.name in ('nt', 'dos'):
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)

Expand Down
4 changes: 2 additions & 2 deletions heimdall/env/conf.json
Original file line number Diff line number Diff line change
@@ -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/"
}

},
Expand Down
2 changes: 1 addition & 1 deletion heimdall/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def getConfig():
except:
conf = {
"build": {
"version": "v1.0.1-stable"
"version": "v1.0.2-stable"
},
"defaults": {

Expand Down
24 changes: 0 additions & 24 deletions heimdall/lib/modules/update.py

This file was deleted.

30 changes: 11 additions & 19 deletions heimdall/lib/utils/version.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
17 changes: 9 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
requests
web3
numpy
bidict
alive-progress
argparse
argcomplete
eth_abi
pip-api
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']},
Expand Down

0 comments on commit 2239a47

Please sign in to comment.