Store strict version number in metadata (exclude the platform)

This commit is contained in:
Alex Beregszaszi 2017-01-17 12:09:13 +00:00
parent a466f26c45
commit 350c7e7e2c
4 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,7 @@
Features:
* AST: Use deterministic node identifiers.
* Metadata: Do not include platform in the version number.
### 0.4.8 (2017-01-13)

View File

@ -695,7 +695,7 @@ string CompilerStack::createOnChainMetadata(Contract const& _contract) const
Json::Value meta;
meta["version"] = 1;
meta["language"] = "Solidity";
meta["compiler"]["version"] = VersionString;
meta["compiler"]["version"] = VersionStringStrict;
meta["sources"] = Json::objectValue;
for (auto const& s: m_sources)

View File

@ -38,6 +38,9 @@ string const dev::solidity::VersionString =
(string(SOL_VERSION_PRERELEASE).empty() ? "" : "-" + string(SOL_VERSION_PRERELEASE)) +
(string(SOL_VERSION_BUILDINFO).empty() ? "" : "+" + string(SOL_VERSION_BUILDINFO));
string const dev::solidity::VersionStringStrict =
string(dev::solidity::VersionNumber) +
(string(SOL_VERSION_PRERELEASE).empty() ? "" : "-" + string(SOL_VERSION_PRERELEASE));
bytes dev::solidity::binaryVersion()
{

View File

@ -32,6 +32,7 @@ namespace solidity
extern char const* VersionNumber;
extern std::string const VersionString;
extern std::string const VersionStringStrict;
/// @returns a binary form of the version string, where A.B.C-HASH is encoded such that
/// the first byte is zero, the following three bytes encode A B and C (interpreted as decimals)