@@ -212,6 +212,12 @@ def test_sighash_mismatch(self):
212
212
def_wallet .sendtoaddress (addr , 5 )
213
213
self .generate (self .nodes [0 ], 6 )
214
214
215
+ # Retrieve the descriptors so we can do all of the tests with descriptorprocesspsbt as well
216
+ if self .options .descriptors :
217
+ descs = wallet .listdescriptors (True )["descriptors" ]
218
+ else :
219
+ descs = [descsum_create (f"wpkh({ wallet .dumpprivkey (addr )} )" )]
220
+
215
221
# Make a PSBT
216
222
psbt = wallet .walletcreatefundedpsbt ([], [{def_wallet .getnewaddress (): 1 }])["psbt" ]
217
223
@@ -228,6 +234,15 @@ def test_sighash_mismatch(self):
228
234
proc = wallet .walletprocesspsbt (psbt , True , "ALL|ANYONECANPAY" )
229
235
assert_equal (proc ["complete" ], True )
230
236
237
+ # Repeat with descriptorprocesspsbt
238
+ # Mismatching sighash type fails, including when no type is specified
239
+ for sighash in ["DEFAULT" , "ALL" , "NONE" , "SINGLE" , "NONE|ANYONECANPAY" , "SINGLE|ANYONECANPAY" , None ]:
240
+ assert_raises_rpc_error (- 22 , "Specified sighash value does not match value stored in PSBT" , self .nodes [0 ].descriptorprocesspsbt , psbt , descs , sighash )
241
+
242
+ # Matching sighash type succeeds
243
+ proc = self .nodes [0 ].descriptorprocesspsbt (psbt , descs , "ALL|ANYONECANPAY" )
244
+ assert_equal (proc ["complete" ], True )
245
+
231
246
wallet .unloadwallet ()
232
247
233
248
def test_sighash_adding (self ):
0 commit comments