From 78ad5fe524f83f458f17530573efa3a0fb8423bf Mon Sep 17 00:00:00 2001 From: Andrei Maiboroda Date: Thu, 28 Sep 2023 09:12:18 +0200 Subject: [PATCH] Move trace output earlier in state transition tests (#714) --- test/unittests/state_transition.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/unittests/state_transition.cpp b/test/unittests/state_transition.cpp index aecb69d05b..a58700968e 100644 --- a/test/unittests/state_transition.cpp +++ b/test/unittests/state_transition.cpp @@ -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()) { @@ -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