mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Added tests for --no-append-metadata
- Command line tests - Documented the standard json - Changelog - A Change in SolidityExecutionFramework to prevent flaky gas tests - A boost test for --no-append-metadata - Removed an outdated comment
This commit is contained in:
@@ -92,6 +92,7 @@ BOOST_AUTO_TEST_CASE(string_storage)
|
||||
}
|
||||
)";
|
||||
m_compiler.setMetadataFormat(CompilerStack::MetadataFormat::NoMetadata);
|
||||
m_appendCBORMetadata = false;
|
||||
compileAndRun(sourceCode);
|
||||
|
||||
auto evmVersion = solidity::test::CommonOptions::get().evmVersion();
|
||||
|
||||
@@ -53,7 +53,7 @@ SemanticTest::SemanticTest(
|
||||
bool _enforceGasCost,
|
||||
u256 _enforceGasCostMinValue
|
||||
):
|
||||
SolidityExecutionFramework(_evmVersion, _vmPaths),
|
||||
SolidityExecutionFramework(_evmVersion, _vmPaths, false),
|
||||
EVMVersionRestrictedTestCase(_filename),
|
||||
m_sources(m_reader.sources()),
|
||||
m_lineOffset(m_reader.lineNumber()),
|
||||
|
||||
@@ -62,6 +62,9 @@ bytes SolidityExecutionFramework::multiSourceCompileContract(
|
||||
m_compiler.enableEvmBytecodeGeneration(!m_compileViaYul);
|
||||
m_compiler.enableIRGeneration(m_compileViaYul);
|
||||
m_compiler.setRevertStringBehaviour(m_revertStrings);
|
||||
if (!m_appendCBORMetadata) {
|
||||
m_compiler.setMetadataFormat(CompilerStack::MetadataFormat::NoMetadata);
|
||||
}
|
||||
m_compiler.setMetadataHash(m_metadataHash);
|
||||
if (!m_compiler.compile())
|
||||
{
|
||||
|
||||
@@ -40,8 +40,14 @@ class SolidityExecutionFramework: public solidity::test::ExecutionFramework
|
||||
|
||||
public:
|
||||
SolidityExecutionFramework(): m_showMetadata(solidity::test::CommonOptions::get().showMetadata) {}
|
||||
explicit SolidityExecutionFramework(langutil::EVMVersion _evmVersion, std::vector<boost::filesystem::path> const& _vmPaths):
|
||||
ExecutionFramework(_evmVersion, _vmPaths), m_showMetadata(solidity::test::CommonOptions::get().showMetadata)
|
||||
explicit SolidityExecutionFramework(
|
||||
langutil::EVMVersion _evmVersion,
|
||||
std::vector<boost::filesystem::path> const& _vmPaths,
|
||||
bool _appendCBORMetadata = true
|
||||
):
|
||||
ExecutionFramework(_evmVersion, _vmPaths),
|
||||
m_showMetadata(solidity::test::CommonOptions::get().showMetadata),
|
||||
m_appendCBORMetadata(_appendCBORMetadata)
|
||||
{}
|
||||
|
||||
bytes const& compileAndRunWithoutCheck(
|
||||
@@ -80,6 +86,7 @@ protected:
|
||||
bool m_compileViaYul = false;
|
||||
bool m_compileToEwasm = false;
|
||||
bool m_showMetadata = false;
|
||||
bool m_appendCBORMetadata = true;
|
||||
CompilerStack::MetadataHash m_metadataHash = CompilerStack::MetadataHash::IPFS;
|
||||
RevertStrings m_revertStrings = RevertStrings::Default;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user