diff --git a/test/functional/feature_block_reward_reallocation.py b/test/functional/feature_block_reward_reallocation.py index 83caf9c3385b9f..51b0b2a2e45743 100755 --- a/test/functional/feature_block_reward_reallocation.py +++ b/test/functional/feature_block_reward_reallocation.py @@ -122,6 +122,7 @@ def run_test(self): bi = self.nodes[0].getblockchaininfo() assert_equal(bi['blocks'], 1499) assert_equal(bi['bip9_softforks']['realloc']['statistics']['threshold'], self.threshold(2)) + pre_locked_in_blockhash = bi['bestblockhash'] self.signal(396, True) # just enough to lock in self.log.info("Advanced to LOCKED_IN at height = 1999") @@ -180,5 +181,27 @@ def run_test(self): assert_equal(bt['coinbasevalue'], 9491484944) assert_equal(bt['masternode'][0]['amount'], 5694890966) # 0.6 + self.log.info("Rollback the chain back to the STARTED state") + self.mocktime = self.nodes[0].getblock(pre_locked_in_blockhash, 1)['time'] + for node in self.nodes: + node.invalidateblock(pre_locked_in_blockhash) + self.sync_all() + # create and send non-signalling block + test_block = self.create_test_block() + self.nodes[0].p2p.send_blocks_and_test([test_block], self.nodes[0], timeout=5) + bi = self.nodes[0].getblockchaininfo() + assert_equal(bi['blocks'], 1499) + assert_equal(bi['bip9_softforks']['realloc']['status'], 'started') + assert_equal(bi['bip9_softforks']['realloc']['statistics']['threshold'], self.threshold(2)) + + self.log.info("Check thresholds reach min level and stay there") + for i in range(8): # 7 to reach min level and 1 more to check it doesn't go lower than that + self.signal(0, False) # no need to signal + bi = self.nodes[0].getblockchaininfo() + assert_equal(bi['blocks'], 1999 + i * 500) + assert_equal(bi['bip9_softforks']['realloc']['status'], 'started') + assert_equal(bi['bip9_softforks']['realloc']['statistics']['threshold'], self.threshold(i + 3)) + assert_equal(bi['bip9_softforks']['realloc']['statistics']['threshold'], 300) + if __name__ == '__main__': BlockRewardReallocationTest().main() diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 71c5440aa03bc1..95067e71e40cb5 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -59,6 +59,7 @@ # Scripts that are run by the travis build process. # Longest test should go first, to favor running tests in parallel 'feature_dip3_deterministicmns.py', # NOTE: needs dash_hash to pass + 'feature_block_reward_reallocation.py', 'wallet_hd.py', 'wallet_backup.py', # vv Tests less than 5m vv @@ -82,7 +83,6 @@ 'feature_llmq_is_retroactive.py', # NOTE: needs dash_hash to pass 'feature_llmq_dkgerrors.py', # NOTE: needs dash_hash to pass 'feature_dip4_coinbasemerkleroots.py', # NOTE: needs dash_hash to pass - 'feature_block_reward_reallocation.py', # vv Tests less than 60s vv 'p2p_sendheaders.py', # NOTE: needs dash_hash to pass 'wallet_zapwallettxes.py',