Skip to content

Commit 5bc9b64

Browse files
committed
Merge bitcoin/bitcoin#30264: test: add coverage for errors for combinerawtransaction
ab98e6f test: add coverage for errors for `combinerawtransaction` RPC (brunoerg) Pull request description: This PR adds test coverage for the following errors for the `combinerawtransaction` RPC: * Tx decode failed * Missing transactions * Input not found or already spent For reference: https://maflcko.github.io/b-c-cov/total.coverage/src/rpc/rawtransaction.cpp.gcov.html ACKs for top commit: maflcko: lgtm ACK ab98e6f tdb3: ACK ab98e6f Tree-SHA512: 8a133c25dad2e1b236e0278a88796f60f763e3fd6fbbc080f926bb23f9dcc55599aa242d6e0c4ec15a179d9ded10a1f17ee5b6063719107ea84e6099f10416b2
2 parents 0fbb804 + ab98e6f commit 5bc9b64

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/functional/rpc_rawtransaction.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,13 +585,16 @@ def raw_multisig_transaction_legacy_tests(self):
585585
rawTxPartialSigned2 = self.nodes[2].signrawtransactionwithwallet(rawTx2, inputs)
586586
self.log.debug(rawTxPartialSigned2)
587587
assert_equal(rawTxPartialSigned2['complete'], False) # node2 only has one key, can't comp. sign the tx
588+
assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].combinerawtransaction, [rawTxPartialSigned1['hex'], rawTxPartialSigned2['hex'] + "00"])
589+
assert_raises_rpc_error(-22, "Missing transactions", self.nodes[0].combinerawtransaction, [])
588590
rawTxComb = self.nodes[2].combinerawtransaction([rawTxPartialSigned1['hex'], rawTxPartialSigned2['hex']])
589591
self.log.debug(rawTxComb)
590592
self.nodes[2].sendrawtransaction(rawTxComb)
591593
rawTx2 = self.nodes[0].decoderawtransaction(rawTxComb)
592594
self.sync_all()
593595
self.generate(self.nodes[0], 1)
594596
assert_equal(self.nodes[0].getbalance(), bal + Decimal('50.00000000') + Decimal('2.19000000')) # block reward + tx
597+
assert_raises_rpc_error(-25, "Input not found or already spent", self.nodes[0].combinerawtransaction, [rawTxPartialSigned1['hex'], rawTxPartialSigned2['hex']])
595598

596599

597600
if __name__ == '__main__':

0 commit comments

Comments
 (0)