Skip to content

Commit 097c4aa

Browse files
committed
Bugfix: test/functional/rpc_psbt: Remove check for specific error message 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.
1 parent a4eaaa6 commit 097c4aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/functional/rpc_psbt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ def run_test(self):
144144
self.nodes[0].decodepsbt(new_psbt)
145145

146146
# Make sure that a psbt with signatures cannot be converted
147+
# Error could be either "TX decode failed" (segwit inputs causes parsing to fail) or "Inputs must not have scriptSigs and scriptWitnesses"
147148
signedtx = self.nodes[0].signrawtransactionwithwallet(rawtx['hex'])
148-
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].converttopsbt, signedtx['hex'])
149-
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].converttopsbt, signedtx['hex'], False)
149+
assert_raises_rpc_error(-22, "", self.nodes[0].converttopsbt, signedtx['hex'])
150+
assert_raises_rpc_error(-22, "", self.nodes[0].converttopsbt, signedtx['hex'], False)
150151
# Unless we allow it to convert and strip signatures
151152
self.nodes[0].converttopsbt(signedtx['hex'], True)
152153

0 commit comments

Comments
 (0)