Skip to content

Commit

Permalink
Use temp function
Browse files Browse the repository at this point in the history
  • Loading branch information
dsiganos committed Jan 21, 2024
1 parent 66543a3 commit ba002c6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nano/core_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,14 @@ TEST (node, fork_publish_inactive)
ASSERT_EQ (nano::process_result::fork, node.process_local (send2).value ().code);

ASSERT_TIMELY_EQ (5s, election->blocks ().size (), 2);
ASSERT_TRUE (election->blocks ().end () != election->blocks ().find (send1->hash ()));
ASSERT_TRUE (election->blocks ().end () != election->blocks ().find (send2->hash ()));

auto find_block = [&election] (nano::block_hash hash_a) -> bool {
auto blocks = election->blocks ();
return blocks.end () != blocks.find (hash_a);
};
ASSERT_TRUE (find_block (send1->hash ()));
ASSERT_TRUE (find_block (send2->hash ()));

ASSERT_EQ (election->winner ()->hash (), send1->hash ());
ASSERT_NE (election->winner ()->hash (), send2->hash ());
}
Expand Down

0 comments on commit ba002c6

Please sign in to comment.