Implementing enforcing gas expectations in isoltest.

Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
This commit is contained in:
Djordje Mijovic
2021-03-09 21:26:45 +01:00
co-authored by Daniel Kirchner
parent 515f15f7a3
commit aed3832b27
8 changed files with 56 additions and 9 deletions
+15 -2
View File
@@ -40,13 +40,24 @@ class SemanticTest: public SolidityExecutionFramework, public EVMVersionRestrict
{
public:
static std::unique_ptr<TestCase> create(Config const& _options)
{ return std::make_unique<SemanticTest>(_options.filename, _options.evmVersion, _options.vmPaths, _options.enforceCompileViaYul); }
{
return std::make_unique<SemanticTest>(
_options.filename,
_options.evmVersion,
_options.vmPaths,
_options.enforceCompileViaYul,
_options.enforceGasCost,
_options.enforceGasCostMinValue
);
}
explicit SemanticTest(
std::string const& _filename,
langutil::EVMVersion _evmVersion,
std::vector<boost::filesystem::path> const& _vmPaths,
bool _enforceViaYul = false
bool _enforceViaYul = false,
bool _enforceGasCost = false,
u256 _enforceGasCostMinValue = 100000
);
TestResult run(std::ostream& _stream, std::string const& _linePrefix = "", bool _formatted = false) override;
@@ -80,6 +91,8 @@ private:
std::map<std::string, Builtin> m_builtins{};
bool m_gasCostFailure = false;
bool m_enforceGasCost = false;
u256 m_enforceGasCostMinValue;
};
}