diff options
author | Matt Corallo <git@bluematt.me> | 2017-02-02 15:11:28 -0500 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2017-02-02 17:32:28 -0500 |
commit | 691710a648c54c96c302ebbe666da85cfaada5f9 (patch) | |
tree | 363c7864c6279624bd5d4a2c948c0aa461d30dc2 | |
parent | 922bea90c274d45b13812a031242964aa15b6c1d (diff) |
[qa] Test that decoderawtransaction throws with extra data appended
-rwxr-xr-x | qa/rpc-tests/signrawtransactions.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/qa/rpc-tests/signrawtransactions.py b/qa/rpc-tests/signrawtransactions.py index c61a280616..009f01f79b 100755 --- a/qa/rpc-tests/signrawtransactions.py +++ b/qa/rpc-tests/signrawtransactions.py @@ -78,6 +78,16 @@ class SignRawTransactionsTest(BitcoinTestFramework): outputs = {'mpLQjfK79b7CCV4VMJWEWAj5Mpx8Up5zxB': 0.1} rawTx = self.nodes[0].createrawtransaction(inputs, outputs) + + # Make sure decoderawtransaction is at least marginally sane + decodedRawTx = self.nodes[0].decoderawtransaction(rawTx) + for i, inp in enumerate(inputs): + assert_equal(decodedRawTx["vin"][i]["txid"], inp["txid"]) + assert_equal(decodedRawTx["vin"][i]["vout"], inp["vout"]) + + # Make sure decoderawtransaction throws if there is extra data + assert_raises(JSONRPCException, self.nodes[0].decoderawtransaction, rawTx + "00") + rawTxSigned = self.nodes[0].signrawtransaction(rawTx, scripts, privKeys) # 3) The transaction has no complete set of signatures |