Check that functions exist in isoltest.

This commit is contained in:
chriseth
2020-02-13 13:22:53 +01:00
committed by Mathias Baumann
parent f31332533f
commit 9aed40ab19
9 changed files with 32 additions and 3 deletions
@@ -114,6 +114,9 @@ string TestFunctionCall::format(
}
else
{
if (m_calledNonExistingFunction)
_errorReporter.warning("The function \"" + m_call.signature + "\" is not known to the compiler.");
bytes output = m_rawBytes;
bool const isFailure = m_failure;
result = isFailure ?
@@ -300,6 +303,7 @@ void TestFunctionCall::reset()
{
m_rawBytes = bytes{};
m_failure = true;
m_calledNonExistingFunction = false;
}
bool TestFunctionCall::matchesExpectation() const
+3
View File
@@ -77,6 +77,7 @@ public:
void reset();
FunctionCall const& call() const { return m_call; }
void calledNonExistingFunction() { m_calledNonExistingFunction = true; }
void setFailure(const bool _failure) { m_failure = _failure; }
void setRawBytes(const bytes _rawBytes) { m_rawBytes = _rawBytes; }
void setContractABI(Json::Value _contractABI) { m_contractABI = std::move(_contractABI); }
@@ -129,6 +130,8 @@ private:
/// JSON object which holds the contract ABI and that is used to set the output formatting
/// in the interactive update routine.
Json::Value m_contractABI;
/// Flags that the test failed because the called function is not known to exist on the contract.
bool m_calledNonExistingFunction = false;
};
}