From 5df01a5abde1064ab66f5305f25c7338eb467daf Mon Sep 17 00:00:00 2001 From: serkixenos Date: Tue, 15 Dec 2020 18:53:50 +0100 Subject: [PATCH 1/2] Hotfix: Betting tests --- tests/betting/betting_tests.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/betting/betting_tests.cpp b/tests/betting/betting_tests.cpp index cb7c473a..cb6118a6 100644 --- a/tests/betting/betting_tests.cpp +++ b/tests/betting/betting_tests.cpp @@ -3015,7 +3015,8 @@ boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]) { std::cout << "Random number generator seeded to " << time(NULL) << std::endl; // betting operations don't take effect until HARDFORK 1000 - GRAPHENE_TESTING_GENESIS_TIMESTAMP = HARDFORK_1000_TIME.sec_since_epoch() + 15; + GRAPHENE_TESTING_GENESIS_TIMESTAMP = + (HARDFORK_1000_TIME.sec_since_epoch() + 15) / GRAPHENE_DEFAULT_BLOCK_INTERVAL * GRAPHENE_DEFAULT_BLOCK_INTERVAL; return nullptr; } From 3dd0eac49fa4a698736cd8844be0f65a470f8c16 Mon Sep 17 00:00:00 2001 From: serkixenos Date: Tue, 15 Dec 2020 20:23:29 +0100 Subject: [PATCH 2/2] Hotfix: Fix failing GPOS tests --- tests/tests/gpos_tests.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/tests/gpos_tests.cpp b/tests/tests/gpos_tests.cpp index 22908c07..14be6fe2 100644 --- a/tests/tests/gpos_tests.cpp +++ b/tests/tests/gpos_tests.cpp @@ -851,7 +851,10 @@ BOOST_AUTO_TEST_CASE( worker_dividends_voting ) { try { // advance to HF - generate_blocks(HARDFORK_GPOS_TIME); + fc::time_point_sec GPOS_HARDFORK_TIME = + fc::time_point_sec(1581976800); // Use mainnet GPOS hardfork time + + generate_blocks(GPOS_HARDFORK_TIME); generate_block(); // update default gpos global parameters to 4 days @@ -905,7 +908,7 @@ BOOST_AUTO_TEST_CASE( worker_dividends_voting ) vote_for(voter1_id, worker.vote_for, voter1_private_key); // first maint pass, coefficient will be 1 - generate_blocks(HARDFORK_GPOS_TIME + fc::hours(12)); //forward 1/2 sub-period so that it consider only gpos votes + generate_blocks(GPOS_HARDFORK_TIME + fc::hours(12)); //forward 1/2 sub-period so that it consider only gpos votes worker = worker_id_type()(db); BOOST_CHECK_EQUAL(worker.total_votes_for, 100); @@ -966,7 +969,10 @@ BOOST_AUTO_TEST_CASE( account_multiple_vesting ) { try { // advance to HF - generate_blocks(HARDFORK_GPOS_TIME); + fc::time_point_sec GPOS_HARDFORK_TIME = + fc::time_point_sec(1581976800); // Use mainnet GPOS hardfork time + + generate_blocks(GPOS_HARDFORK_TIME); generate_block(); set_expiration(db, trx); @@ -1009,7 +1015,7 @@ BOOST_AUTO_TEST_CASE( account_multiple_vesting ) vote_for(sam_id, witness1.vote_id, sam_private_key); vote_for(patty_id, witness1.vote_id, patty_private_key); - generate_blocks(HARDFORK_GPOS_TIME + fc::hours(12)); //forward 1/2 sub-period so that it consider only gpos votes + generate_blocks(GPOS_HARDFORK_TIME + fc::hours(12)); //forward 1/2 sub-period so that it consider only gpos votes // amount in vested balanced will sum up as voting power witness1 = witness_id_type(1)(db);