Skip to content

Commit 4b87190

Browse files
committed
Use importdescriptors for descriptor wallets in wallet_bumpfee.py
If using descriptor wallets, use importdescriptors instead of importmulti.
1 parent c2711e4 commit 4b87190

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

test/functional/wallet_bumpfee.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def test_segwit_bumpfee_succeeds(self, rbf_node, dest_address):
184184
# which spends it, and make sure bumpfee can be called on it.
185185

186186
segwit_in = next(u for u in rbf_node.listunspent() if u["amount"] == Decimal("0.001"))
187-
segwit_out = rbf_node.getaddressinfo(rbf_node.getnewaddress(address_type='p2sh-segwit'))
187+
segwit_out = rbf_node.getaddressinfo(rbf_node.getnewaddress(address_type='bech32'))
188188
segwitid = send_to_witness(
189189
use_p2wsh=False,
190190
node=rbf_node,
@@ -365,7 +365,7 @@ def test_watchonly_psbt(self, peer_node, rbf_node, dest_address):
365365
rbf_node.createwallet(wallet_name="signer", disable_private_keys=False, blank=True)
366366
signer = rbf_node.get_wallet_rpc("signer")
367367
assert signer.getwalletinfo()['private_keys_enabled']
368-
result = signer.importmulti([{
368+
reqs = [{
369369
"desc": priv_rec_desc,
370370
"timestamp": 0,
371371
"range": [0,1],
@@ -378,29 +378,39 @@ def test_watchonly_psbt(self, peer_node, rbf_node, dest_address):
378378
"range": [0, 0],
379379
"internal": True,
380380
"keypool": False
381-
}])
381+
}]
382+
if self.options.descriptors:
383+
result = signer.importdescriptors(reqs)
384+
else:
385+
result = signer.importmulti(reqs)
382386
assert_equal(result, [{'success': True}, {'success': True}])
383387

384388
# Create another wallet with just the public keys, which creates PSBTs
385389
rbf_node.createwallet(wallet_name="watcher", disable_private_keys=True, blank=True)
386390
watcher = rbf_node.get_wallet_rpc("watcher")
387391
assert not watcher.getwalletinfo()['private_keys_enabled']
388392

389-
result = watcher.importmulti([{
393+
reqs = [{
390394
"desc": pub_rec_desc,
391395
"timestamp": 0,
392396
"range": [0, 10],
393397
"internal": False,
394398
"keypool": True,
395-
"watchonly": True
399+
"watchonly": True,
400+
"active": True,
396401
}, {
397402
"desc": pub_change_desc,
398403
"timestamp": 0,
399404
"range": [0, 10],
400405
"internal": True,
401406
"keypool": True,
402-
"watchonly": True
403-
}])
407+
"watchonly": True,
408+
"active": True,
409+
}]
410+
if self.options.descriptors:
411+
result = watcher.importdescriptors(reqs)
412+
else:
413+
result = watcher.importmulti(reqs)
404414
assert_equal(result, [{'success': True}, {'success': True}])
405415

406416
funding_address1 = watcher.getnewaddress(address_type='bech32')

0 commit comments

Comments
 (0)