Skip to content

Commit 4e18152

Browse files
authored
Merge pull request #2269 from bitshares/hf-date-5
Set Mainnet HF time to 2020-09-28 17:02:00 UTC
2 parents 794b14c + 988a164 commit 4e18152

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// bitshares-core issue #2262: Remove voting power from liquid BTS and tickets
22
#ifndef HARDFORK_CORE_2262_TIME
3-
// Jan 1 2030, midnight; this is a dummy date until a hardfork date is scheduled
4-
#define HARDFORK_CORE_2262_TIME (fc::time_point_sec( 1893456000 ))
3+
#define HARDFORK_CORE_2262_TIME (fc::time_point_sec( 1601312520 )) // Monday, September 28, 2020 17:02:00 UTC
54
#define HARDFORK_CORE_2262_PASSED(next_maint_time) (next_maint_time > HARDFORK_CORE_2262_TIME)
65
#endif
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Liquidity pool
22
#ifndef HARDFORK_LIQUIDITY_POOL_TIME
3-
// Jan 1 2030, midnight; this is a dummy date until a hardfork date is scheduled
4-
#define HARDFORK_LIQUIDITY_POOL_TIME (fc::time_point_sec( 1893456000 ))
3+
#define HARDFORK_LIQUIDITY_POOL_TIME (fc::time_point_sec( 1601312520 )) // Monday, September 28, 2020 17:02:00 UTC
54
#define HARDFORK_LIQUIDITY_POOL_PASSED(now) (now >= HARDFORK_LIQUIDITY_POOL_TIME)
65
#endif

tests/tests/voting_tests.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -784,15 +784,16 @@ BOOST_AUTO_TEST_CASE( witness_votes_calculation )
784784
generate_blocks( db.get_dynamic_global_properties().next_maintenance_time );
785785

786786
// pob activated
787+
bool has_hf_2262 = ( HARDFORK_CORE_2262_PASSED( db.get_dynamic_global_properties().next_maintenance_time ) );
787788
expected_votes[0] = 0; // 225 days
788789
expected_votes[1] = 0; // 270 days
789790
expected_votes[2] = 0; // 315 days
790791
expected_votes[3] = 0; // 360 days
791792
int64_t base4 = 40 * 8 + (114 - 40) - 40;
792-
expected_votes[4] = base4 - base4 * 2 / 8; // 405 days
793+
expected_votes[4] = ( has_hf_2262 ? 0 : ( base4 - base4 * 2 / 8 ) ); // 405 days
793794
expected_votes[5] = 0; // 450 days
794795
expected_votes[6] = 0; // 495 days
795-
int64_t base7 = 20 * 8 * 8 + (30 - 20) * 8 + (117 - 30 - 20) - (30 - 20);
796+
int64_t base7 = 20 * 8 * 8 + ( has_hf_2262 ? 0 : ( (30 - 20) * 8 + (117 - 30 - 20) - (30 - 20) ) );
796797
expected_votes[7] = base7 - base7 * 5 / 8; // 540 days
797798
expected_votes[8] = 0; // 585 days
798799
expected_votes[9] = 0; // 630 days
@@ -808,16 +809,19 @@ BOOST_AUTO_TEST_CASE( witness_votes_calculation )
808809

809810
expected_active_witnesses = original_wits;
810811
expected_active_witnesses.erase( *expected_active_witnesses.rbegin() );
811-
expected_active_witnesses.erase( *expected_active_witnesses.rbegin() );
812-
expected_active_witnesses.insert( wit_ids[4] );
812+
if( !has_hf_2262 )
813+
{
814+
expected_active_witnesses.erase( *expected_active_witnesses.rbegin() );
815+
expected_active_witnesses.insert( wit_ids[4] );
816+
}
813817
expected_active_witnesses.insert( wit_ids[7] );
814818
BOOST_CHECK( db.get_global_properties().active_witnesses == expected_active_witnesses );
815819

816820
// some days passed
817821
generate_blocks( tick_start_time + fc::days(60+180) );
818822
generate_blocks( db.get_dynamic_global_properties().next_maintenance_time );
819823

820-
bool has_hf_2262 = ( HARDFORK_CORE_2262_PASSED( db.get_dynamic_global_properties().next_maintenance_time ) );
824+
has_hf_2262 = ( HARDFORK_CORE_2262_PASSED( db.get_dynamic_global_properties().next_maintenance_time ) );
821825
// check votes
822826
base4 = 40 * 6 + (114 - 40) - 40;
823827
expected_votes[4] = ( has_hf_2262 ? 0 : (base4 - base4 * 6 / 8) ); // 585 days

0 commit comments

Comments
 (0)