mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[isoltest] Add support for events using call side-effects.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user