aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_psbt.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/rpc_psbt.py')
-rwxr-xr-xtest/functional/rpc_psbt.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py
index 51ea0216b6..7c653cc315 100755
--- a/test/functional/rpc_psbt.py
+++ b/test/functional/rpc_psbt.py
@@ -400,17 +400,15 @@ class PSBTTest(BitcoinTestFramework):
self.nodes[0].decodepsbt(new_psbt)
# 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, hexstring=signedtx['hex'], iswitness=True)
- assert_raises_rpc_error(-22, "", self.nodes[0].converttopsbt, hexstring=signedtx['hex'], permitsigdata=False, iswitness=True)
+ assert_raises_rpc_error(-22, "Inputs must not have scriptSigs and scriptWitnesses",
+ self.nodes[0].converttopsbt, hexstring=signedtx['hex']) # permitsigdata=False by default
+ assert_raises_rpc_error(-22, "Inputs must not have scriptSigs and scriptWitnesses",
+ self.nodes[0].converttopsbt, hexstring=signedtx['hex'], permitsigdata=False)
+ assert_raises_rpc_error(-22, "Inputs must not have scriptSigs and scriptWitnesses",
+ 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)
-
- # Explicitly allow converting non-empty txs
- new_psbt = self.nodes[0].converttopsbt(rawtx['hex'])
- self.nodes[0].decodepsbt(new_psbt)
+ self.nodes[0].converttopsbt(hexstring=signedtx['hex'], permitsigdata=True)
# Create outputs to nodes 1 and 2
node1_addr = self.nodes[1].getnewaddress()