65
65
assert_equal ,
66
66
softfork_active ,
67
67
)
68
+ from test_framework .wallet import MiniWallet
69
+
68
70
69
71
# TestP2PConn: A peer we use to send messages to bitcoind, and store responses.
70
72
class TestP2PConn (P2PInterface ):
@@ -150,9 +152,6 @@ def set_test_params(self):
150
152
]]
151
153
self .utxos = []
152
154
153
- def skip_test_if_missing_module (self ):
154
- self .skip_if_no_wallet ()
155
-
156
155
def build_block_on_tip (self , node , segwit = False ):
157
156
block = create_block (tmpl = node .getblocktemplate (NORMAL_GBT_REQUEST_PARAMS ))
158
157
if segwit :
@@ -165,7 +164,7 @@ def make_utxos(self):
165
164
block = self .build_block_on_tip (self .nodes [0 ])
166
165
self .segwit_node .send_and_ping (msg_no_witness_block (block ))
167
166
assert int (self .nodes [0 ].getbestblockhash (), 16 ) == block .sha256
168
- self .generatetoaddress (self .nodes [ 0 ] , COINBASE_MATURITY , self . nodes [ 0 ]. getnewaddress ( address_type = "bech32" ) )
167
+ self .generate (self .wallet , COINBASE_MATURITY )
169
168
170
169
total_value = block .vtx [0 ].vout [0 ].nValue
171
170
out_value = total_value // 10
@@ -296,12 +295,10 @@ def test_compactblock_construction(self, test_node, use_witness_address=True):
296
295
# Generate a bunch of transactions.
297
296
self .generate (node , COINBASE_MATURITY + 1 )
298
297
num_transactions = 25
299
- address = node .getnewaddress ()
300
298
301
299
segwit_tx_generated = False
302
300
for _ in range (num_transactions ):
303
- txid = node .sendtoaddress (address , 0.1 )
304
- hex_tx = node .gettransaction (txid )["hex" ]
301
+ hex_tx = self .wallet .send_self_transfer (from_node = self .nodes [0 ])['hex' ]
305
302
tx = tx_from_hex (hex_tx )
306
303
if not tx .wit .is_null ():
307
304
segwit_tx_generated = True
@@ -843,8 +840,7 @@ def assert_highbandwidth_states(node, hb_to, hb_from):
843
840
assert_highbandwidth_states (self .nodes [0 ], hb_to = True , hb_from = False )
844
841
845
842
def run_test (self ):
846
- # Get the nodes out of IBD
847
- self .generate (self .nodes [0 ], 1 )
843
+ self .wallet = MiniWallet (self .nodes [0 ])
848
844
849
845
# Setup the p2p connections
850
846
self .segwit_node = self .nodes [0 ].add_p2p_connection (TestP2PConn (cmpct_version = 2 ))
0 commit comments