[isoltest] Add support for events using call side-effects.

This commit is contained in:
Alexander Arlt
2021-05-27 23:21:55 -05:00
parent aec20f0038
commit ec86e3e9ae
11 changed files with 210 additions and 9 deletions
+22
View File
@@ -19,6 +19,8 @@
#include <test/ExecutionFramework.h>
#include <utility>
namespace solidity::frontend::test
{
@@ -311,4 +313,24 @@ struct FunctionCall
using Builtin = std::function<std::optional<bytes>(FunctionCall const&)>;
using SideEffectHook = std::function<std::vector<std::string>(FunctionCall const&)>;
struct LogRecord
{
util::h160 creator;
bytes data;
std::vector<util::h256> topics;
LogRecord(util::h160 _creator, bytes _data, std::vector<util::h256> _topics):
creator(std::move(_creator)), data(std::move(_data)), topics(std::move(_topics)) {}
bool operator==(LogRecord const& other) const noexcept
{
return creator == other.creator && data == other.data && topics == other.topics;
}
bool operator!=(LogRecord const& other) const noexcept
{
return !operator==(other);
}
};
}
+2 -2
View File
@@ -196,8 +196,6 @@ string TestFunctionCall::format(
}
}
stream << formatGasExpectations(_linePrefix, _renderMode == RenderMode::ExpectedValuesActualGas, _interactivePrint);
vector<string> sideEffects;
if (_renderMode == RenderMode::ExpectedValuesExpectedGas || _renderMode == RenderMode::ExpectedValuesActualGas)
sideEffects = m_call.expectedSideEffects;
@@ -214,6 +212,8 @@ string TestFunctionCall::format(
stream << std::endl;
}
}
stream << formatGasExpectations(_linePrefix, _renderMode == RenderMode::ExpectedValuesActualGas, _interactivePrint);
};
formatOutput(m_call.displayMode == FunctionCall::DisplayMode::SingleLine);