Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions test/functional/rpc_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,16 @@ def run_test(self):
signedtx = self.nodes[0].signrawtransactionwithwallet(rawtx['hex'])
assert_raises_rpc_error(-22, "Inputs must not have scriptSigs", self.nodes[0].converttopsbt, hexstring=signedtx['hex'])
assert_raises_rpc_error(-22, "Inputs must not have scriptSigs", self.nodes[0].converttopsbt, hexstring=signedtx['hex'], permitsigdata=False)
# Make sure that a non-psbt with signatures cannot be converted
signedtx = self.nodes[0].signrawtransactionwithwallet(rawtx['hex'])
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()
Expand Down
Loading