@@ -31,9 +31,6 @@ def set_test_params(self):
3131 self .setup_clean_chain = True
3232 self .num_nodes = 1
3333
34- def skip_test_if_missing_module (self ):
35- self .skip_if_no_wallet ()
36-
3734 def setup_network (self ):
3835 self .alert_filename = os .path .join (self .options .tmpdir , "alert.txt" )
3936 # Open and close to create zero-length file
@@ -68,13 +65,14 @@ def run_test(self):
6865 node = self .nodes [0 ]
6966 node .add_p2p_connection (P2PInterface ())
7067
68+ node_deterministic_address = node .get_deterministic_priv_key ().address
7169 # Mine one period worth of blocks
72- node .generate (VB_PERIOD )
70+ node .generatetoaddress (VB_PERIOD , node_deterministic_address )
7371
7472 self .log .info ("Check that there is no warning if previous VB_BLOCKS have <VB_THRESHOLD blocks with unknown versionbits version." )
7573 # Build one period of blocks with < VB_THRESHOLD blocks signaling some unknown bit
7674 self .send_blocks_with_version (node .p2p , VB_THRESHOLD - 1 , VB_UNKNOWN_VERSION )
77- node .generate (VB_PERIOD - VB_THRESHOLD + 1 )
75+ node .generatetoaddress (VB_PERIOD - VB_THRESHOLD + 1 , node_deterministic_address )
7876
7977 # Check that we're not getting any versionbit-related errors in get*info()
8078 assert (not VB_PATTERN .match (node .getmininginfo ()["warnings" ]))
@@ -83,7 +81,7 @@ def run_test(self):
8381 self .log .info ("Check that there is a warning if >50 blocks in the last 100 were an unknown version" )
8482 # Build one period of blocks with VB_THRESHOLD blocks signaling some unknown bit
8583 self .send_blocks_with_version (node .p2p , VB_THRESHOLD , VB_UNKNOWN_VERSION )
86- node .generate (VB_PERIOD - VB_THRESHOLD )
84+ node .generatetoaddress (VB_PERIOD - VB_THRESHOLD , node_deterministic_address )
8785
8886 # Check that get*info() shows the 51/100 unknown block version error.
8987 assert (WARN_UNKNOWN_RULES_MINED in node .getmininginfo ()["warnings" ])
@@ -92,16 +90,16 @@ def run_test(self):
9290 self .log .info ("Check that there is a warning if previous VB_BLOCKS have >=VB_THRESHOLD blocks with unknown versionbits version." )
9391 # Mine a period worth of expected blocks so the generic block-version warning
9492 # is cleared. This will move the versionbit state to ACTIVE.
95- node .generate (VB_PERIOD )
93+ node .generatetoaddress (VB_PERIOD , node_deterministic_address )
9694
9795 # Stop-start the node. This is required because bitcoind will only warn once about unknown versions or unknown rules activating.
9896 self .restart_node (0 )
9997
10098 # Generating one block guarantees that we'll get out of IBD
101- node .generate ( 1 )
99+ node .generatetoaddress ( 1 , node_deterministic_address )
102100 wait_until (lambda : not node .getblockchaininfo ()['initialblockdownload' ], timeout = 10 , lock = mininode_lock )
103101 # Generating one more block will be enough to generate an error.
104- node .generate ( 1 )
102+ node .generatetoaddress ( 1 , node_deterministic_address )
105103 # Check that get*info() shows the versionbits unknown rules warning
106104 assert (WARN_UNKNOWN_RULES_ACTIVE in node .getmininginfo ()["warnings" ])
107105 assert (WARN_UNKNOWN_RULES_ACTIVE in node .getnetworkinfo ()["warnings" ])
0 commit comments