Fix tests
This commit is contained in:
parent
8f9ffb915d
commit
3fa82a05e3
3 changed files with 7 additions and 10 deletions
|
|
@ -658,7 +658,6 @@ TEST (active_elections, vote_replays)
|
|||
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
|
||||
.work (*system.work.generate (nano::dev::genesis->hash ()))
|
||||
.build ();
|
||||
ASSERT_NE (nullptr, send1);
|
||||
|
||||
// create open block for key receing Knano_ratio raw
|
||||
auto open1 = builder.make_block ()
|
||||
|
|
@ -670,11 +669,9 @@ TEST (active_elections, vote_replays)
|
|||
.sign (key.prv, key.pub)
|
||||
.work (*system.work.generate (key.pub))
|
||||
.build ();
|
||||
ASSERT_NE (nullptr, open1);
|
||||
|
||||
// wait for elections objects to appear in the AEC
|
||||
node.process_active (send1);
|
||||
node.process_active (open1);
|
||||
nano::test::process (node, { send1, open1 });
|
||||
ASSERT_TRUE (nano::test::start_elections (system, node, { send1, open1 }));
|
||||
ASSERT_EQ (2, node.active.size ());
|
||||
|
||||
|
|
@ -709,8 +706,7 @@ TEST (active_elections, vote_replays)
|
|||
.sign (key.prv, key.pub)
|
||||
.work (*system.work.generate (open1->hash ()))
|
||||
.build ();
|
||||
ASSERT_NE (nullptr, send2);
|
||||
node.process_active (send2);
|
||||
nano::test::process (node, { send2 });
|
||||
ASSERT_TRUE (nano::test::start_elections (system, node, { send2 }));
|
||||
ASSERT_EQ (1, node.active.size ());
|
||||
|
||||
|
|
|
|||
|
|
@ -152,10 +152,12 @@ TEST (election, quorum_minimum_confirm_success)
|
|||
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
|
||||
.build ();
|
||||
node1.work_generate_blocking (*send1);
|
||||
node1.process_active (send1);
|
||||
|
||||
nano::test::process (node1, { send1 });
|
||||
auto election = nano::test::start_election (system, node1, send1->hash ());
|
||||
ASSERT_NE (nullptr, election);
|
||||
ASSERT_EQ (1, election->blocks ().size ());
|
||||
|
||||
auto vote = nano::test::make_final_vote (nano::dev::genesis_key, { send1->hash () });
|
||||
ASSERT_EQ (nano::vote_code::vote, node1.vote_router.vote (vote).at (send1->hash ()));
|
||||
ASSERT_NE (nullptr, node1.block (send1->hash ()));
|
||||
|
|
@ -182,7 +184,7 @@ TEST (election, quorum_minimum_confirm_fail)
|
|||
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
|
||||
.build ();
|
||||
|
||||
node1.process_active (send1);
|
||||
nano::test::process (node1, { send1 });
|
||||
auto election = nano::test::start_election (system, node1, send1->hash ());
|
||||
ASSERT_NE (nullptr, election);
|
||||
ASSERT_EQ (1, election->blocks ().size ());
|
||||
|
|
|
|||
|
|
@ -6820,8 +6820,7 @@ TEST (rpc, confirmation_active)
|
|||
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
|
||||
.work (*system.work.generate (send1->hash ()))
|
||||
.build ();
|
||||
node1->process_active (send1);
|
||||
node1->process_active (send2);
|
||||
nano::test::process (*node1, { send1, send2 });
|
||||
ASSERT_TRUE (nano::test::start_elections (system, *node1, { send1, send2 }));
|
||||
ASSERT_EQ (2, node1->active.size ());
|
||||
auto election (node1->active.election (send1->qualified_root ()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue