aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2016-09-09 16:30:29 +0800
committerGitHub <noreply@github.com>2016-09-09 16:30:29 +0800
commitfb86d90e080b0fbbcf7b7f328352f9794802c8c4 (patch)
treef0a47a3e3f8276f4b59e03f2ca31a421eb43d3e4
parent8a057e3f854a0f9ef5d7f09ff861da90079ded61 (diff)
parent6a55405160475fa6166df4888c8d821b4105f879 (diff)
downloaddexon-solidity-fb86d90e080b0fbbcf7b7f328352f9794802c8c4.tar.gz
dexon-solidity-fb86d90e080b0fbbcf7b7f328352f9794802c8c4.tar.zst
dexon-solidity-fb86d90e080b0fbbcf7b7f328352f9794802c8c4.zip
Merge pull request #1070 from ethereum/devversion
Fix problems with version strings.
-rw-r--r--libsolidity/interface/Version.cpp8
-rw-r--r--test/contracts/AuctionRegistrar.cpp2
-rw-r--r--test/contracts/FixedFeeRegistrar.cpp2
-rw-r--r--test/contracts/Wallet.cpp2
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp2
5 files changed, 9 insertions, 7 deletions
diff --git a/libsolidity/interface/Version.cpp b/libsolidity/interface/Version.cpp
index 31ba4afc..0dca1ced 100644
--- a/libsolidity/interface/Version.cpp
+++ b/libsolidity/interface/Version.cpp
@@ -58,12 +58,14 @@ bytes dev::solidity::binaryVersion()
solAssert(i < VersionString.size() && VersionString[i] == '.', "");
++i;
ret.push_back(byte(parseDecimal()));
- solAssert(i < VersionString.size() && VersionString[i] == '-', "");
+ solAssert(i < VersionString.size() && (VersionString[i] == '-' || VersionString[i] == '+'), "");
++i;
+ size_t commitpos = VersionString.find("commit.");
+ solAssert(commitpos != string::npos, "");
+ i = commitpos + 7;
solAssert(i + 7 < VersionString.size(), "");
bytes commitHash = fromHex(VersionString.substr(i, 8));
- if (commitHash.empty())
- commitHash = bytes(4, 0);
+ solAssert(!commitHash.empty(), "");
ret += commitHash;
solAssert(ret.size() == 1 + 3 + 4, "");
diff --git a/test/contracts/AuctionRegistrar.cpp b/test/contracts/AuctionRegistrar.cpp
index 05da3490..277de4eb 100644
--- a/test/contracts/AuctionRegistrar.cpp
+++ b/test/contracts/AuctionRegistrar.cpp
@@ -39,7 +39,7 @@ namespace
{
static char const* registrarCode = R"DELIMITER(
-pragma solidity ^0.3.5;
+pragma solidity ^0.4.0;
contract NameRegister {
function addr(string _name) constant returns (address o_owner);
diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp
index af8ee595..736015fa 100644
--- a/test/contracts/FixedFeeRegistrar.cpp
+++ b/test/contracts/FixedFeeRegistrar.cpp
@@ -52,7 +52,7 @@ static char const* registrarCode = R"DELIMITER(
// @authors:
// Gav Wood <g@ethdev.com>
-pragma solidity ^0.3.5;
+pragma solidity ^0.4.0;
contract Registrar {
event Changed(string indexed name);
diff --git a/test/contracts/Wallet.cpp b/test/contracts/Wallet.cpp
index b4f29a87..cfc630d4 100644
--- a/test/contracts/Wallet.cpp
+++ b/test/contracts/Wallet.cpp
@@ -55,7 +55,7 @@ static char const* walletCode = R"DELIMITER(
// some number (specified in constructor) of the set of owners (specified in the constructor, modifiable) before the
// interior is executed.
-pragma solidity ^0.3.5;
+pragma solidity ^0.4.0;
contract multiowned {
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 3c85d8a8..7ee5700c 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -5961,7 +5961,7 @@ BOOST_AUTO_TEST_CASE(version_stamp_for_libraries)
bytes runtimeCode = compileAndRun(sourceCode, 0, "lib");
BOOST_CHECK(runtimeCode.size() >= 8);
BOOST_CHECK_EQUAL(runtimeCode[0], int(Instruction::PUSH6)); // might change once we switch to 1.x.x
- BOOST_CHECK_EQUAL(runtimeCode[1], 3); // might change once we switch away from x.3.x
+ BOOST_CHECK_EQUAL(runtimeCode[1], 4); // might change once we switch away from x.4.x
BOOST_CHECK_EQUAL(runtimeCode[7], int(Instruction::POP));
}