@@ -115,7 +115,7 @@ def test_segwit_bumpfee_succeeds(rbf_node, dest_address):
115
115
'vout' : 0 ,
116
116
"sequence" : BIP125_SEQUENCE_NUMBER
117
117
}], {dest_address : Decimal ("0.0005" ),
118
- get_change_address ( rbf_node ): Decimal ("0.0003" )})
118
+ rbf_node . getrawchangeaddress ( ): Decimal ("0.0003" )})
119
119
rbfsigned = rbf_node .signrawtransaction (rbfraw )
120
120
rbfid = rbf_node .sendrawtransaction (rbfsigned ["hex" ])
121
121
assert rbfid in rbf_node .getrawmempool ()
@@ -167,13 +167,15 @@ def test_small_output_fails(rbf_node, dest_address):
167
167
rbfid = spend_one_input (rbf_node ,
168
168
Decimal ("0.00100000" ),
169
169
{dest_address : 0.00080000 ,
170
- get_change_address ( rbf_node ): Decimal ("0.00010000" )})
170
+ rbf_node . getrawchangeaddress ( ): Decimal ("0.00010000" )})
171
171
rbf_node .bumpfee (rbfid , {"totalFee" : 20000 })
172
172
173
173
rbfid = spend_one_input (rbf_node ,
174
174
Decimal ("0.00100000" ),
175
175
{dest_address : 0.00080000 ,
176
176
get_change_address (rbf_node ): Decimal ("0.00010000" )})
177
+ get_change_address (rbf_node ): Decimal ("0.00010000" )})
178
+ rbf_node .getrawchangeaddress (): Decimal ("0.00010000" )})
177
179
assert_raises_jsonrpc (- 4 , "Change output is too small" , rbf_node .bumpfee , rbfid , {"totalFee" : 20001 })
178
180
179
181
@@ -183,7 +185,7 @@ def test_dust_to_fee(rbf_node, dest_address):
183
185
rbfid = spend_one_input (rbf_node ,
184
186
Decimal ("0.00100000" ),
185
187
{dest_address : 0.00080000 ,
186
- get_change_address ( rbf_node ): Decimal ("0.00010000" )})
188
+ rbf_node . getrawchangeaddress ( ): Decimal ("0.00010000" )})
187
189
fulltx = rbf_node .getrawtransaction (rbfid , 1 )
188
190
bumped_tx = rbf_node .bumpfee (rbfid , {"totalFee" : 19900 })
189
191
full_bumped_tx = rbf_node .getrawtransaction (bumped_tx ["txid" ], 1 )
@@ -288,21 +290,6 @@ def spend_one_input(node, input_amount, outputs):
288
290
return txid
289
291
290
292
291
- def get_change_address (node ):
292
- """Get a wallet change address.
293
-
294
- There is no wallet RPC to access unused change addresses, so this creates a
295
- dummy transaction, calls fundrawtransaction to give add an input and change
296
- output, then returns the change address."""
297
- dest_address = node .getnewaddress ()
298
- dest_amount = Decimal ("0.00012345" )
299
- rawtx = node .createrawtransaction ([], {dest_address : dest_amount })
300
- fundtx = node .fundrawtransaction (rawtx )
301
- info = node .decoderawtransaction (fundtx ["hex" ])
302
- return next (address for out in info ["vout" ]
303
- if out ["value" ] != dest_amount for address in out ["scriptPubKey" ]["addresses" ])
304
-
305
-
306
293
def submit_block_with_tx (node , tx ):
307
294
ctx = CTransaction ()
308
295
ctx .deserialize (io .BytesIO (hex_str_to_bytes (tx )))
0 commit comments