@@ -301,9 +301,21 @@ def do_test_psbt(self, comment, pattern, privmap, treefn, keys_pay, keys_change)
301
301
test_balance = int (self .psbt_online .getbalance () * 100000000 )
302
302
ret_amnt = random .randrange (100000 , test_balance )
303
303
# Increase fee_rate to compensate for the wallet's inability to estimate fees for script path spends.
304
- psbt = self .psbt_online .walletcreatefundedpsbt ([], [{self .boring .getnewaddress (): Decimal (ret_amnt ) / 100000000 }], None , {"subtractFeeFromOutputs" :[0 ], "fee_rate" : 200 })['psbt' ]
305
- res = self .psbt_offline .walletprocesspsbt (psbt )
306
- assert (res ['complete' ])
304
+ psbt = self .psbt_online .walletcreatefundedpsbt ([], [{self .boring .getnewaddress (): Decimal (ret_amnt ) / 100000000 }], None , {"subtractFeeFromOutputs" :[0 ], "fee_rate" : 200 , "change_type" : "bech32m" })['psbt' ]
305
+ res = self .psbt_offline .walletprocesspsbt (psbt = psbt , finalize = False )
306
+
307
+ decoded = self .psbt_offline .decodepsbt (res ["psbt" ])
308
+ if pattern .startswith ("tr(" ):
309
+ for psbtin in decoded ["inputs" ]:
310
+ assert "non_witness_utxo" not in psbtin
311
+ assert "witness_utxo" in psbtin
312
+ assert "taproot_internal_key" in psbtin
313
+ assert "taproot_bip32_derivs" in psbtin
314
+ assert "taproot_key_path_sig" in psbtin or "taproot_script_path_sigs" in psbtin
315
+ if "taproot_script_path_sigs" in psbtin :
316
+ assert "taproot_merkle_root" in psbtin
317
+ assert "taproot_scripts" in psbtin
318
+
307
319
rawtx = self .nodes [0 ].finalizepsbt (res ['psbt' ])['hex' ]
308
320
txid = self .nodes [0 ].sendrawtransaction (rawtx )
309
321
self .generatetoaddress (self .nodes [0 ], 1 , self .boring .getnewaddress (), sync_fun = self .no_op )
0 commit comments