From fa499b5f027f77c0bf13699852c8c06f78e27bef Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 26 Apr 2019 09:04:08 -0400 Subject: rpc: bugfix: Properly use iswitness in converttopsbt Also explain the param in all RPCs --- test/functional/rpc_psbt.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/functional/rpc_psbt.py') diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py index 8a7ea7aa58..430be6dd37 100755 --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -152,9 +152,10 @@ class PSBTTest(BitcoinTestFramework): # Make sure that a non-psbt with signatures cannot be converted # Error could be either "TX decode failed" (segwit inputs causes parsing to fail) or "Inputs must not have scriptSigs and scriptWitnesses" + # We must set iswitness=True because the serialized transaction has inputs and is therefore a witness transaction signedtx = self.nodes[0].signrawtransactionwithwallet(rawtx['hex']) - assert_raises_rpc_error(-22, "", self.nodes[0].converttopsbt, signedtx['hex']) - assert_raises_rpc_error(-22, "", self.nodes[0].converttopsbt, signedtx['hex'], False) + assert_raises_rpc_error(-22, "", self.nodes[0].converttopsbt, hexstring=signedtx['hex'], iswitness=True) + assert_raises_rpc_error(-22, "", self.nodes[0].converttopsbt, hexstring=signedtx['hex'], permitsigdata=False, iswitness=True) # Unless we allow it to convert and strip signatures self.nodes[0].converttopsbt(signedtx['hex'], True) -- cgit v1.2.3