MCPcopy Create free account
hub / github.com/argotorg/solidity / processBytecodeFormatSetting

Method processBytecodeFormatSetting

test/TestCase.cpp:147–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void EVMVersionRestrictedTestCase::processBytecodeFormatSetting()
148{
149 std::optional<uint8_t> eofVersion = solidity::test::CommonOptions::get().eofVersion();
150 // EOF only available since Osaka
151 solAssert(!eofVersion.has_value() || solidity::test::CommonOptions::get().evmVersion().supportsEOF());
152
153 std::string bytecodeFormatString = m_reader.stringSetting("bytecodeFormat", "legacy,>=EOFv1");
154 if (bytecodeFormatString == "legacy,>=EOFv1" || bytecodeFormatString == ">=EOFv1,legacy")
155 return;
156
157 // TODO: This is naive implementation because for now we support only one EOF version.
158 if (bytecodeFormatString == "legacy" && eofVersion.has_value())
159 m_shouldRun = false;
160 else if (bytecodeFormatString == ">=EOFv1" && !eofVersion.has_value())
161 m_shouldRun = false;
162 else if (bytecodeFormatString != "legacy" && bytecodeFormatString != ">=EOFv1" )
163 BOOST_THROW_EXCEPTION(std::runtime_error{"Invalid bytecodeFormat flag: \"" + bytecodeFormatString + "\""});
164}
165
166EVMVersionRestrictedTestCase::EVMVersionRestrictedTestCase(std::string const& _filename):
167 TestCase(_filename)

Callers

nothing calls this directly

Calls 5

getFunction · 0.85
supportsEOFMethod · 0.80
stringSettingMethod · 0.80
eofVersionMethod · 0.45
evmVersionMethod · 0.45

Tested by

no test coverage detected