From d44752bf59629cb1bf0f65484edb2292a78153cd Mon Sep 17 00:00:00 2001 From: Piper Merriam Date: Sat, 30 Sep 2017 07:29:29 -0600 Subject: [PATCH 1/3] test against 0.4.17 too --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 14b0fe9..e7e4aeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -105,6 +105,13 @@ matrix: env: TOX_POSARGS="-e py34-stdlib -e py34-gevent" SOLC_VERSION=v0.4.16 - python: "3.5" env: TOX_POSARGS="-e py35-stdlib -e py35-gevent" SOLC_VERSION=v0.4.16 + # solc 0.4.17 + - python: "2.7" + env: TOX_POSARGS="-e py27-stdlib -e py27-gevent" SOLC_VERSION=v0.4.17 + - python: "3.4" + env: TOX_POSARGS="-e py34-stdlib -e py34-gevent" SOLC_VERSION=v0.4.17 + - python: "3.5" + env: TOX_POSARGS="-e py35-stdlib -e py35-gevent" SOLC_VERSION=v0.4.17 cache: - pip: true before_install: From e8688d6784270585614dc06202f8d4117cc05959 Mon Sep 17 00:00:00 2001 From: Piper Merriam Date: Sat, 30 Sep 2017 21:16:52 -0600 Subject: [PATCH 2/3] fix test fixture supported solc versions --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 15051ed..fe1f906 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -16,7 +16,7 @@ def contracts_dir(tmpdir): @pytest.fixture() def supported_solc_version(): solc_version = get_solc_version() - if solc_version not in Spec('>=0.4.1,<=0.4.16,!=0.4.10,!=0.4.3,!=0.4.4,!=0.4.5'): + if solc_version not in Spec('>=0.4.1,<=0.4.17,!=0.4.10,!=0.4.3,!=0.4.4,!=0.4.5'): raise AssertionError("Unsupported compiler version: {0}".format(solc_version)) return solc_version From 4622cc6ce4245a5d0207a6bed6c36d0f0cc13a74 Mon Sep 17 00:00:00 2001 From: Piper Merriam Date: Sun, 1 Oct 2017 20:28:02 -0600 Subject: [PATCH 3/3] Support for solc 0.4.17 warnings --- tests/conftest.py | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index fe1f906..9a9a291 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,9 +13,13 @@ def contracts_dir(tmpdir): return str(tmpdir.mkdir("contracts")) +@pytest.fixture(scope="session") +def solc_version(): + return get_solc_version() + + @pytest.fixture() -def supported_solc_version(): - solc_version = get_solc_version() +def supported_solc_version(solc_version): if solc_version not in Spec('>=0.4.1,<=0.4.17,!=0.4.10,!=0.4.3,!=0.4.4,!=0.4.5'): raise AssertionError("Unsupported compiler version: {0}".format(solc_version)) @@ -28,18 +32,31 @@ def is_new_key_format(): @pytest.fixture() -def FOO_SOURCE(supported_solc_version): - return textwrap.dedent('''\ - pragma solidity ^0.4.0; +def FOO_SOURCE(supported_solc_version, solc_version): + if solc_version in Spec('<0.4.17'): + return textwrap.dedent('''\ + pragma solidity ^0.4.0; - contract Foo { - function Foo() {} + contract Foo { + function Foo() {} - function return13() returns (uint) { - return 13; + function return13() public returns (uint) { + return 13; + } } - } - ''') + ''') + else: + return textwrap.dedent('''\ + pragma solidity ^0.4.17; + + contract Foo { + function Foo() public {} + + function return13() public pure returns (uint) { + return 13; + } + } + ''') @pytest.fixture() @@ -48,7 +65,7 @@ def BAR_SOURCE(supported_solc_version): pragma solidity ^0.4.0; contract Bar { - function Bar() {} + function Bar() public {} } ''') @@ -61,9 +78,9 @@ def BAZ_SOURCE(supported_solc_version): import "contracts/Bar.sol"; contract Baz is Bar { - function Baz() {} + function Baz() public {} - function get_funky() returns (string) { + function get_funky() public returns (string) { return "funky"; } }