Skip to content

Commit 8cca1fb

Browse files
author
MarcoFalke
committed
Merge #14818: Bugfix: test/functional/rpc_psbt: Remove check for specific error message that depends on uncertain assumptions
c87fc71 Bugfix: test/functional/rpc_psbt: Correct test description comment (Luke Dashjr) 097c4aa Bugfix: test/functional/rpc_psbt: Remove check for specific error message that depends on uncertain assumptions (Luke Dashjr) Pull request description: 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. ACKs for commit c87fc7: instagibbs: utACK bitcoin/bitcoin@c87fc71 achow101: utACK c87fc71 Tree-SHA512: 61312b5d49aa50652902f30ba9693dfba9e5b7e6478f23becda20202d8b328ddb3e040f2199b617a68df133a5f1f8b5d68bc19d4621303f17c1963dca01bd9ef
2 parents 40a720a + c87fc71 commit 8cca1fb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/functional/rpc_psbt.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,11 @@ def run_test(self):
150150
new_psbt = self.nodes[0].converttopsbt(rawtx['hex'])
151151
self.nodes[0].decodepsbt(new_psbt)
152152

153-
# Make sure that a psbt with signatures cannot be converted
153+
# Make sure that a non-psbt with signatures cannot be converted
154+
# Error could be either "TX decode failed" (segwit inputs causes parsing to fail) or "Inputs must not have scriptSigs and scriptWitnesses"
154155
signedtx = self.nodes[0].signrawtransactionwithwallet(rawtx['hex'])
155-
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].converttopsbt, signedtx['hex'])
156-
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].converttopsbt, signedtx['hex'], False)
156+
assert_raises_rpc_error(-22, "", self.nodes[0].converttopsbt, signedtx['hex'])
157+
assert_raises_rpc_error(-22, "", self.nodes[0].converttopsbt, signedtx['hex'], False)
157158
# Unless we allow it to convert and strip signatures
158159
self.nodes[0].converttopsbt(signedtx['hex'], True)
159160

0 commit comments

Comments
 (0)