From 7908e2d5e2dae1d5b88c079f6eb92389e94ab7ef Mon Sep 17 00:00:00 2001 From: Guilherme Lawless Date: Mon, 27 Apr 2020 17:26:28 +0100 Subject: [PATCH] Fix rpc.wallet_history failures (#2739) 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. --- nano/rpc_test/rpc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nano/rpc_test/rpc.cpp b/nano/rpc_test/rpc.cpp index 87dbb2392..ae8e64c81 100644 --- a/nano/rpc_test/rpc.cpp +++ b/nano/rpc_test/rpc.cpp @@ -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);