Skip to content

Commit

Permalink
Use deque rather than vector to support large initialization sequences (
Browse files Browse the repository at this point in the history
  • Loading branch information
clemahieu authored May 23, 2024
1 parent dae8314 commit e9adb74
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nano/slow_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ TEST (system, block_sequence)
size_t const pr_count = 4;
size_t const listeners_per_pr = 0;
nano::test::system system;
std::vector<nano::keypair> reps;
std::deque<nano::keypair> reps;
for (auto i = 0; i < pr_count; ++i)
{
reps.push_back (nano::keypair{});
Expand Down
2 changes: 1 addition & 1 deletion nano/test_common/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void nano::test::system::stop_node (nano::node & node)
debug_assert (!ec);
}

void nano::test::system::ledger_initialization_set (std::vector<nano::keypair> const & reps, nano::amount const & reserve)
void nano::test::system::ledger_initialization_set (std::deque<nano::keypair> const & reps, nano::amount const & reserve)
{
nano::block_hash previous = nano::dev::genesis->hash ();
auto amount = (nano::dev::constants.genesis_amount - reserve.number ()) / reps.size ();
Expand Down
4 changes: 2 additions & 2 deletions nano/test_common/system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace test

void stop ();

void ledger_initialization_set (std::vector<nano::keypair> const & reps, nano::amount const & reserve = 0);
void ledger_initialization_set (std::deque<nano::keypair> const & reps, nano::amount const & reserve = 0);
void generate_activity (nano::node &, std::vector<nano::account> &);
void generate_mass_activity (uint32_t, nano::node &);
void generate_usage_traffic (uint32_t, uint32_t, size_t);
Expand Down Expand Up @@ -87,7 +87,7 @@ namespace test
std::chrono::time_point<std::chrono::steady_clock, std::chrono::duration<double>> deadline{ std::chrono::steady_clock::time_point::max () };
double deadline_scaling_factor{ 1.0 };
unsigned node_sequence{ 0 };
std::vector<std::shared_ptr<nano::block>> initialization_blocks;
std::deque<std::shared_ptr<nano::block>> initialization_blocks;
};

std::shared_ptr<nano::state_block> upgrade_epoch (nano::work_pool &, nano::ledger &, nano::epoch);
Expand Down

0 comments on commit e9adb74

Please sign in to comment.