@@ -283,6 +283,9 @@ def test_sighash_mismatch(self):
283283 def_wallet .sendtoaddress (addr , 5 )
284284 self .generate (self .nodes [0 ], 6 )
285285
286+ # Retrieve the descriptors so we can do all of the tests with descriptorprocesspsbt as well
287+ descs = wallet .listdescriptors (True )["descriptors" ]
288+
286289 # Make a PSBT
287290 psbt = wallet .walletcreatefundedpsbt ([], [{def_wallet .getnewaddress (): 1 }])["psbt" ]
288291
@@ -299,6 +302,15 @@ def test_sighash_mismatch(self):
299302 proc = wallet .walletprocesspsbt (psbt , True , "ALL|ANYONECANPAY" )
300303 assert_equal (proc ["complete" ], True )
301304
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+
302314 wallet .unloadwallet ()
303315
304316 def test_sighash_adding (self ):
0 commit comments