aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbrunoerg <brunoely.gc@gmail.com>2024-06-10 11:34:44 -0300
committerbrunoerg <brunoely.gc@gmail.com>2024-06-10 15:19:24 -0300
commitab98e6fd03970d6b5a593674c84e762a47b90ea6 (patch)
tree5255a7986d046b91472ce5ae965f109151b211e3 /test
parent6e4d18f37f42894fe9a0d7948c1da3f061fc6b60 (diff)
downloadbitcoin-ab98e6fd03970d6b5a593674c84e762a47b90ea6.tar.xz
test: add coverage for errors for `combinerawtransaction` RPC
* Tx decode failed * Missing transactions * Input not found or already spent
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/rpc_rawtransaction.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/functional/rpc_rawtransaction.py b/test/functional/rpc_rawtransaction.py
index 3978c80dde..3eccc904b7 100755
--- a/test/functional/rpc_rawtransaction.py
+++ b/test/functional/rpc_rawtransaction.py
@@ -585,6 +585,8 @@ class RawTransactionsTest(BitcoinTestFramework):
rawTxPartialSigned2 = self.nodes[2].signrawtransactionwithwallet(rawTx2, inputs)
self.log.debug(rawTxPartialSigned2)
assert_equal(rawTxPartialSigned2['complete'], False) # node2 only has one key, can't comp. sign the tx
+ assert_raises_rpc_error(-22, "TX decode failed", self.nodes[0].combinerawtransaction, [rawTxPartialSigned1['hex'], rawTxPartialSigned2['hex'] + "00"])
+ assert_raises_rpc_error(-22, "Missing transactions", self.nodes[0].combinerawtransaction, [])
rawTxComb = self.nodes[2].combinerawtransaction([rawTxPartialSigned1['hex'], rawTxPartialSigned2['hex']])
self.log.debug(rawTxComb)
self.nodes[2].sendrawtransaction(rawTxComb)
@@ -592,6 +594,7 @@ class RawTransactionsTest(BitcoinTestFramework):
self.sync_all()
self.generate(self.nodes[0], 1)
assert_equal(self.nodes[0].getbalance(), bal + Decimal('50.00000000') + Decimal('2.19000000')) # block reward + tx
+ assert_raises_rpc_error(-25, "Input not found or already spent", self.nodes[0].combinerawtransaction, [rawTxPartialSigned1['hex'], rawTxPartialSigned2['hex']])
if __name__ == '__main__':