Skip to content

Commit

Permalink
Move trace output earlier in state transition tests (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 authored Sep 28, 2023
1 parent 74d2143 commit 78ad5fe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/unittests/state_transition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ void state_transition::TearDown()
evmone::state::finalize(
state, rev, block.coinbase, block_reward, block.ommers, block.withdrawals);

if (trace)
{
if (expect.trace.starts_with('\n')) // It's easier to define expected trace with \n.
expect.trace.remove_prefix(1);
EXPECT_EQ(trace_capture->get_capture(), expect.trace);
}

EXPECT_EQ(receipt.status, expect.status);
if (expect.gas_used.has_value())
{
Expand Down Expand Up @@ -110,12 +117,5 @@ void state_transition::TearDown()
{
EXPECT_TRUE(expect.post.contains(addr)) << "unexpected account " << addr;
}

if (trace)
{
if (expect.trace.starts_with('\n')) // It's easier to define expected trace with \n.
expect.trace.remove_prefix(1);
EXPECT_EQ(trace_capture->get_capture(), expect.trace);
}
}
} // namespace evmone::test

0 comments on commit 78ad5fe

Please sign in to comment.