Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking if Solc satisfies version requirements #1394

9 changes: 9 additions & 0 deletions raiden/blockchain/abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from raiden.utils import get_contract_path
from raiden.constants import MIN_REQUIRED_SOLC

from distutils.version import LooseVersion

__all__ = (
'CONTRACT_MANAGER',

Expand Down Expand Up @@ -134,6 +136,13 @@ def validate_solc():
"Make sure the solidity compiler is installed and available on your $PATH."
)

elif LooseVersion(_solidity.compiler_version()) < LooseVersion(MIN_REQUIRED_SOLC[1:]):
raise RuntimeError(
'You are currently using the solidity compiler version {0}.\n'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to add numbers inside the {} for the format string

'Please upgrade to the compatible version {1}.'.format(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please upgrade to the compatible version -> Please upgrade to the minimum compatible version

_solidity.compiler_version(), MIN_REQUIRED_SOLC)
)

try:
_solidity.compile_contract(
get_contract_path('HumanStandardToken.sol'),
Expand Down