Skip to content

Commit

Permalink
Make tests compile
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Oct 20, 2024
1 parent 7ef8130 commit 435fcc8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
16 changes: 12 additions & 4 deletions nano/core_test/confirming_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,32 @@ using namespace std::chrono_literals;

TEST (confirming_set, construction)
{
nano::test::system system;
auto & node = *system.add_node ();
auto ctx = nano::test::ledger_empty ();
nano::confirming_set_config config{};
nano::confirming_set confirming_set{ config, ctx.ledger (), ctx.stats (), ctx.logger () };
nano::confirming_set confirming_set{ config, ctx.ledger (), node.block_processor, ctx.stats (), ctx.logger () };
}

TEST (confirming_set, add_exists)
{
nano::test::system system;
auto & node = *system.add_node ();
auto ctx = nano::test::ledger_send_receive ();
nano::confirming_set_config config{};
nano::confirming_set confirming_set{ config, ctx.ledger (), ctx.stats (), ctx.logger () };
nano::confirming_set confirming_set{ config, ctx.ledger (), node.block_processor, ctx.stats (), ctx.logger () };
auto send = ctx.blocks ()[0];
confirming_set.add (send->hash ());
ASSERT_TRUE (confirming_set.contains (send->hash ()));
}

TEST (confirming_set, process_one)
{
nano::test::system system;
auto & node = *system.add_node ();
auto ctx = nano::test::ledger_send_receive ();
nano::confirming_set_config config{};
nano::confirming_set confirming_set{ config, ctx.ledger (), ctx.stats (), ctx.logger () };
nano::confirming_set confirming_set{ config, ctx.ledger (), node.block_processor, ctx.stats (), ctx.logger () };
std::atomic<int> count = 0;
std::mutex mutex;
std::condition_variable condition;
Expand All @@ -52,9 +58,11 @@ TEST (confirming_set, process_one)

TEST (confirming_set, process_multiple)
{
nano::test::system system;
auto & node = *system.add_node ();
auto ctx = nano::test::ledger_send_receive ();
nano::confirming_set_config config{};
nano::confirming_set confirming_set{ config, ctx.ledger (), ctx.stats (), ctx.logger () };
nano::confirming_set confirming_set{ config, ctx.ledger (), node.block_processor, ctx.stats (), ctx.logger () };
std::atomic<int> count = 0;
std::mutex mutex;
std::condition_variable condition;
Expand Down
6 changes: 4 additions & 2 deletions nano/slow_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,9 @@ TEST (confirmation_height, many_accounts_send_receive_self)
// as opposed to active transactions which implicitly calls confirmation height processor.
TEST (confirmation_height, many_accounts_send_receive_self_no_elections)
{
nano::test::system system;
auto & node = *system.nodes[0];

if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
Expand All @@ -1138,7 +1141,7 @@ TEST (confirmation_height, many_accounts_send_receive_self_no_elections)
nano::block_hash block_hash_being_processed{ 0 };
nano::store::write_queue write_queue;
nano::confirming_set_config confirming_set_config{};
nano::confirming_set confirming_set{ confirming_set_config, ledger, stats, logger };
nano::confirming_set confirming_set{ confirming_set_config, ledger, node.block_processor, stats, logger };

auto const num_accounts = 100000;

Expand All @@ -1147,7 +1150,6 @@ TEST (confirmation_height, many_accounts_send_receive_self_no_elections)
std::vector<std::shared_ptr<nano::open_block>> open_blocks;

nano::block_builder builder;
nano::test::system system;

{
auto transaction = ledger.tx_begin_write ();
Expand Down

0 comments on commit 435fcc8

Please sign in to comment.