@@ -283,6 +283,9 @@ def test_sighash_mismatch(self):
283
283
def_wallet .sendtoaddress (addr , 5 )
284
284
self .generate (self .nodes [0 ], 6 )
285
285
286
+ # Retrieve the descriptors so we can do all of the tests with descriptorprocesspsbt as well
287
+ descs = wallet .listdescriptors (True )["descriptors" ]
288
+
286
289
# Make a PSBT
287
290
psbt = wallet .walletcreatefundedpsbt ([], [{def_wallet .getnewaddress (): 1 }])["psbt" ]
288
291
@@ -299,6 +302,15 @@ def test_sighash_mismatch(self):
299
302
proc = wallet .walletprocesspsbt (psbt , True , "ALL|ANYONECANPAY" )
300
303
assert_equal (proc ["complete" ], True )
301
304
305
+ # Repeat with descriptorprocesspsbt
306
+ # Mismatching sighash type fails, including when no type is specified
307
+ for sighash in ["DEFAULT" , "ALL" , "NONE" , "SINGLE" , "NONE|ANYONECANPAY" , "SINGLE|ANYONECANPAY" , None ]:
308
+ assert_raises_rpc_error (- 22 , "Specified sighash value does not match value stored in PSBT" , self .nodes [0 ].descriptorprocesspsbt , psbt , descs , sighash )
309
+
310
+ # Matching sighash type succeeds
311
+ proc = self .nodes [0 ].descriptorprocesspsbt (psbt , descs , "ALL|ANYONECANPAY" )
312
+ assert_equal (proc ["complete" ], True )
313
+
302
314
wallet .unloadwallet ()
303
315
304
316
def test_sighash_adding (self ):
0 commit comments