Skip to content

Commit

Permalink
Merge pull request #621 from ethereum/state-transition-print-account
Browse files Browse the repository at this point in the history
Print account address in state transition test failures
  • Loading branch information
gumb0 authored Apr 24, 2023
2 parents 1831ed4 + e6649b2 commit 8708f24
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/unittests/state_transition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,21 @@ void state_transition::TearDown()
ASSERT_NE(acc, nullptr) << "account " << addr << " should exist";
if (expected_acc.nonce.has_value())
{
EXPECT_EQ(acc->nonce, *expected_acc.nonce);
EXPECT_EQ(acc->nonce, *expected_acc.nonce) << "account " << addr;
}
if (expected_acc.balance.has_value())
{
EXPECT_EQ(acc->balance, *expected_acc.balance)
<< to_string(acc->balance) << " vs " << to_string(*expected_acc.balance);
<< to_string(acc->balance) << " vs " << to_string(*expected_acc.balance)
<< " account " << addr;
}
if (expected_acc.code.has_value())
{
EXPECT_EQ(acc->code, *expected_acc.code);
EXPECT_EQ(acc->code, *expected_acc.code) << "account " << addr;
}
for (const auto& [key, value] : expected_acc.storage)
{
EXPECT_EQ(acc->storage[key].current, value);
EXPECT_EQ(acc->storage[key].current, value) << "account " << addr;
}
for (const auto& [key, value] : acc->storage)
{
Expand Down

0 comments on commit 8708f24

Please sign in to comment.