| 145 | } |
| 146 | |
| 147 | void 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 | |
| 166 | EVMVersionRestrictedTestCase::EVMVersionRestrictedTestCase(std::string const& _filename): |
| 167 | TestCase(_filename) |
nothing calls this directly
no test coverage detected