mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Allow overwriting the release flag for tests and adjust test suite to CBOR metadata.
This commit is contained in:
@@ -1177,7 +1177,7 @@ bytes CompilerStack::createCBORMetadata(string const& _metadata, bool _experimen
|
||||
encoder.pushBytes("bzzr0", dev::swarmHash(_metadata).asBytes());
|
||||
if (_experimentalMode)
|
||||
encoder.pushBool("experimental", true);
|
||||
if (VersionIsRelease)
|
||||
if (m_release)
|
||||
encoder.pushBytes("solc", VersionCompactBytes);
|
||||
else
|
||||
encoder.pushString("solc", VersionStringStrict);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <libsolidity/interface/ReadFile.h>
|
||||
#include <libsolidity/interface/OptimiserSettings.h>
|
||||
#include <libsolidity/interface/Version.h>
|
||||
|
||||
#include <liblangutil/ErrorReporter.h>
|
||||
#include <liblangutil/EVMVersion.h>
|
||||
@@ -261,6 +262,8 @@ public:
|
||||
/// @returns a JSON representing the estimated gas usage for contract creation, internal and external functions
|
||||
Json::Value gasEstimates(std::string const& _contractName) const;
|
||||
|
||||
/// Overwrites the release/prerelease flag. Should only be used for testing.
|
||||
void overwriteReleaseFlag(bool release) { m_release = release; }
|
||||
private:
|
||||
/// The state per source unit. Filled gradually during parsing.
|
||||
struct Source
|
||||
@@ -333,7 +336,7 @@ private:
|
||||
std::string createMetadata(Contract const& _contract) const;
|
||||
|
||||
/// @returns the metadata CBOR for the given serialised metadata JSON.
|
||||
static bytes createCBORMetadata(std::string const& _metadata, bool _experimentalMode);
|
||||
bytes createCBORMetadata(std::string const& _metadata, bool _experimentalMode);
|
||||
|
||||
/// @returns the computer source mapping string.
|
||||
std::string computeSourceMapping(eth::AssemblyItems const& _items) const;
|
||||
@@ -382,6 +385,7 @@ private:
|
||||
langutil::ErrorReporter m_errorReporter;
|
||||
bool m_metadataLiteralSources = false;
|
||||
State m_stackState = Empty;
|
||||
bool m_release = VersionIsRelease;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user