Skip to content

Commit

Permalink
Fix rpc.wallet_history failures (#2739)
Browse files Browse the repository at this point in the history
This was simply due to the first block getting auto received on confirmation so the `receive_action` would fail. Disabling voting solves it.

Removed the thread sleeps, they don't seem to be required for this test.
  • Loading branch information
guilhermelawless committed Apr 27, 2020
1 parent 3abb899 commit 7908e2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nano/rpc_test/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7260,17 +7260,17 @@ TEST (rpc, uptime)
TEST (rpc, wallet_history)
{
nano::system system;
auto node = add_ipc_enabled_node (system);
nano::node_config node_config (nano::get_available_port (), system.logging);
node_config.enable_voting = false;
auto node = add_ipc_enabled_node (system, node_config);
system.wallet (0)->insert_adhoc (nano::test_genesis_key.prv);
auto timestamp1 (nano::seconds_since_epoch ());
auto send (system.wallet (0)->send_action (nano::test_genesis_key.pub, nano::test_genesis_key.pub, node->config.receive_minimum.number ()));
ASSERT_NE (nullptr, send);
std::this_thread::sleep_for (std::chrono::milliseconds (1000));
auto timestamp2 (nano::seconds_since_epoch ());
auto receive (system.wallet (0)->receive_action (*send, nano::test_genesis_key.pub, node->config.receive_minimum.number ()));
ASSERT_NE (nullptr, receive);
nano::keypair key;
std::this_thread::sleep_for (std::chrono::milliseconds (1000));
auto timestamp3 (nano::seconds_since_epoch ());
auto send2 (system.wallet (0)->send_action (nano::test_genesis_key.pub, key.pub, node->config.receive_minimum.number ()));
ASSERT_NE (nullptr, send2);
Expand Down

0 comments on commit 7908e2d

Please sign in to comment.