Skip to content

Commit

Permalink
rpc.online_reps test udpate (nanocurrency#1848)
Browse files Browse the repository at this point in the history
* rpc.online_reps test udpate

send to non existing account to prevent receiving & change of representative weight

* Remove genesis representative test collision
  • Loading branch information
SergiySW authored and Guilherme Lawless committed Apr 15, 2019
1 parent 2089476 commit b5358f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nano/core_test/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4466,9 +4466,10 @@ TEST (rpc, wallet_add_watch)
TEST (rpc, online_reps)
{
nano::system system (24000, 2);
nano::keypair key;
system.wallet (0)->insert_adhoc (nano::test_genesis_key.prv);
ASSERT_TRUE (system.nodes[1]->online_reps.online_stake () == system.nodes[1]->config.online_weight_minimum.number ());
auto send_block (system.wallet (0)->send_action (nano::test_genesis_key.pub, nano::test_genesis_key.pub, nano::Gxrb_ratio));
auto send_block (system.wallet (0)->send_action (nano::test_genesis_key.pub, key.pub, nano::Gxrb_ratio));
ASSERT_NE (nullptr, send_block);
system.deadline_set (10s);
while (system.nodes[1]->online_reps.list ().empty ())
Expand Down Expand Up @@ -4510,9 +4511,8 @@ TEST (rpc, online_reps)
auto weight2 (item2->second.get<std::string> ("weight"));
ASSERT_EQ (system.nodes[1]->weight (nano::test_genesis_key.pub).convert_to<std::string> (), weight2);
//Test accounts filter
system.wallet (1)->insert_adhoc (nano::test_genesis_key.prv);
auto new_rep (system.wallet (1)->deterministic_insert ());
auto send (system.wallet (1)->send_action (nano::test_genesis_key.pub, new_rep, system.nodes[0]->config.receive_minimum.number ()));
auto send (system.wallet (0)->send_action (nano::test_genesis_key.pub, new_rep, system.nodes[0]->config.receive_minimum.number ()));
ASSERT_NE (nullptr, send);
while (system.nodes[1]->block (send->hash ()) == nullptr)
{
Expand All @@ -4524,7 +4524,7 @@ TEST (rpc, online_reps)
{
ASSERT_NO_ERROR (system.poll ());
}
auto change (system.wallet (1)->change_action (nano::test_genesis_key.pub, new_rep));
auto change (system.wallet (0)->change_action (nano::test_genesis_key.pub, new_rep));
ASSERT_NE (nullptr, change);
while (system.nodes[1]->block (change->hash ()) == nullptr)
{
Expand Down

0 comments on commit b5358f0

Please sign in to comment.