Permit Yul interpreter vs Evmone storage comparison.

This commit is contained in:
Bhargava Shastry
2021-04-12 10:39:23 +02:00
parent 124db22f04
commit 033ee0e2bc
6 changed files with 20 additions and 7 deletions
+8 -3
View File
@@ -48,6 +48,13 @@ using namespace solidity::yul::test;
using solidity::util::h256;
void InterpreterState::dumpStorage(ostream& _out) const
{
for (auto const& slot: storage)
if (slot.second != h256{})
_out << " " << slot.first.hex() << ": " << slot.second.hex() << endl;
}
void InterpreterState::dumpTraceAndState(ostream& _out) const
{
_out << "Trace:" << endl;
@@ -61,9 +68,7 @@ void InterpreterState::dumpTraceAndState(ostream& _out) const
if (value != 0)
_out << " " << std::uppercase << std::hex << std::setw(4) << offset << ": " << h256(value).hex() << endl;
_out << "Storage dump:" << endl;
for (auto const& slot: storage)
if (slot.second != h256{})
_out << " " << slot.first.hex() << ": " << slot.second.hex() << endl;
dumpStorage(_out);
}
void Interpreter::run(InterpreterState& _state, Dialect const& _dialect, Block const& _ast)
+3
View File
@@ -99,7 +99,10 @@ struct InterpreterState
size_t maxExprNesting = 0;
ControlFlowState controlFlowState = ControlFlowState::Default;
/// Prints execution trace and non-zero storage to @param _out.
void dumpTraceAndState(std::ostream& _out) const;
/// Prints non-zero storage to @param _out.
void dumpStorage(std::ostream& _out) const;
};
/**