From c98c7bcb94f980a37e7c685675b7d9eeb894bde5 Mon Sep 17 00:00:00 2001
From: pbattu123
Date: Sat, 7 Dec 2019 23:41:22 -0400
Subject: [PATCH] Updated gpos/voting_tests
---
tests/tests/gpos_tests.cpp | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tests/tests/gpos_tests.cpp b/tests/tests/gpos_tests.cpp
index 390ac8f4..d8c87a89 100644
--- a/tests/tests/gpos_tests.cpp
+++ b/tests/tests/gpos_tests.cpp
@@ -658,13 +658,20 @@ BOOST_AUTO_TEST_CASE( voting )
// go to maint
generate_blocks(db.get_dynamic_global_properties().next_maintenance_time);
- // vote is the same as amount in the first subperiod since voting
+ // need to consider both gpos and regular balance for first 1/2 sub period
+ witness1 = witness_id_type(1)(db);
+ witness2 = witness_id_type(2)(db);
+ BOOST_CHECK_EQUAL(witness1.total_votes, 1000);
+ BOOST_CHECK_EQUAL(witness2.total_votes, 1000);
+
+ advance_x_maint(6);
+
witness1 = witness_id_type(1)(db);
witness2 = witness_id_type(2)(db);
BOOST_CHECK_EQUAL(witness1.total_votes, 100);
BOOST_CHECK_EQUAL(witness2.total_votes, 100);
- advance_x_maint(10);
+ advance_x_maint(4);
//Bob votes for witness2 - sub-period 2
vote_for(bob_id, witness2.vote_id, bob_private_key);