Skip to content

Commit

Permalink
Bugfix: test/functional/rpc_psbt: Remove check for specific error mes…
Browse files Browse the repository at this point in the history
…sage that depends on uncertain assumptions

When converttopsbt is called with a signed transaction, it either fails with "TX decode failed" if one or more inputs were segwit, or "Inputs must not have scriptSigs and scriptWitnesses" otherwise.
Since no effort is made by the test to ensure the inputs are segwit or not, avoid checking the exact message used.
The error code is still checked to ensure it is of the correct kind of failure.
  • Loading branch information
luke-jr committed Nov 27, 2018
1 parent a4eaaa6 commit 097c4aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/functional/rpc_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ def run_test(self):
self.nodes[0].decodepsbt(new_psbt)

# Make sure that a 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"
signedtx = self.nodes[0].signrawtransactionwithwallet(rawtx['hex'])
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].converttopsbt, signedtx['hex'])
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].converttopsbt, signedtx['hex'], False)
assert_raises_rpc_error(-22, "", self.nodes[0].converttopsbt, signedtx['hex'])
assert_raises_rpc_error(-22, "", self.nodes[0].converttopsbt, signedtx['hex'], False)
# Unless we allow it to convert and strip signatures
self.nodes[0].converttopsbt(signedtx['hex'], True)

Expand Down

0 comments on commit 097c4aa

Please sign in to comment.