Skip to content

Commit 039ef21

Browse files
achow101fanquake
authored andcommitted
tests: Use descriptor that requires both legacy and segwit
Github-Pull: #24454 Rebased-From: 9f5ab67
1 parent 5fd25eb commit 039ef21

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/functional/rpc_psbt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,8 @@ def test_psbt_input_keys(psbt_input, keys):
619619
self.nodes[1].createwallet("extfund")
620620
wallet = self.nodes[1].get_wallet_rpc("extfund")
621621

622-
# Make a weird but signable script. sh(pkh()) descriptor accomplishes this
623-
desc = descsum_create("sh(pkh({}))".format(privkey))
622+
# Make a weird but signable script. sh(wsh(pkh())) descriptor accomplishes this
623+
desc = descsum_create("sh(wsh(pkh({})))".format(privkey))
624624
if self.options.descriptors:
625625
res = self.nodes[0].importdescriptors([{"desc": desc, "timestamp": "now"}])
626626
else:
@@ -638,7 +638,7 @@ def test_psbt_input_keys(psbt_input, keys):
638638
assert_raises_rpc_error(-4, "Insufficient funds", wallet.walletcreatefundedpsbt, [ext_utxo], {self.nodes[0].getnewaddress(): 15})
639639

640640
# But funding should work when the solving data is provided
641-
psbt = wallet.walletcreatefundedpsbt([ext_utxo], {self.nodes[0].getnewaddress(): 15}, 0, {"add_inputs": True, "solving_data": {"pubkeys": [addr_info['pubkey']], "scripts": [addr_info["embedded"]["scriptPubKey"]]}})
641+
psbt = wallet.walletcreatefundedpsbt([ext_utxo], {self.nodes[0].getnewaddress(): 15}, 0, {"add_inputs": True, "solving_data": {"pubkeys": [addr_info['pubkey']], "scripts": [addr_info["embedded"]["scriptPubKey"], addr_info["embedded"]["embedded"]["scriptPubKey"]]}})
642642
signed = wallet.walletprocesspsbt(psbt['psbt'])
643643
assert not signed['complete']
644644
signed = self.nodes[0].walletprocesspsbt(signed['psbt'])

test/functional/wallet_send.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@ def run_test(self):
492492
self.nodes[1].createwallet("extfund")
493493
ext_fund = self.nodes[1].get_wallet_rpc("extfund")
494494

495-
# Make a weird but signable script. sh(pkh()) descriptor accomplishes this
496-
desc = descsum_create("sh(pkh({}))".format(privkey))
495+
# Make a weird but signable script. sh(wsh(pkh())) descriptor accomplishes this
496+
desc = descsum_create("sh(wsh(pkh({})))".format(privkey))
497497
if self.options.descriptors:
498498
res = ext_fund.importdescriptors([{"desc": desc, "timestamp": "now"}])
499499
else:
@@ -511,7 +511,7 @@ def run_test(self):
511511
self.test_send(from_wallet=ext_wallet, to_wallet=self.nodes[0], amount=15, inputs=[ext_utxo], add_inputs=True, psbt=True, include_watching=True, expect_error=(-4, "Insufficient funds"))
512512

513513
# But funding should work when the solving data is provided
514-
res = self.test_send(from_wallet=ext_wallet, to_wallet=self.nodes[0], amount=15, inputs=[ext_utxo], add_inputs=True, psbt=True, include_watching=True, solving_data={"pubkeys": [addr_info['pubkey']], "scripts": [addr_info["embedded"]["scriptPubKey"]]})
514+
res = self.test_send(from_wallet=ext_wallet, to_wallet=self.nodes[0], amount=15, inputs=[ext_utxo], add_inputs=True, psbt=True, include_watching=True, solving_data={"pubkeys": [addr_info['pubkey']], "scripts": [addr_info["embedded"]["scriptPubKey"], addr_info["embedded"]["embedded"]["scriptPubKey"]]})
515515
signed = ext_wallet.walletprocesspsbt(res["psbt"])
516516
signed = ext_fund.walletprocesspsbt(res["psbt"])
517517
assert signed["complete"]

0 commit comments

Comments
 (0)