Skip to content

Commit 691710a

Browse files
committed
[qa] Test that decoderawtransaction throws with extra data appended
1 parent 922bea9 commit 691710a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

qa/rpc-tests/signrawtransactions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ def script_verification_error_test(self):
7878
outputs = {'mpLQjfK79b7CCV4VMJWEWAj5Mpx8Up5zxB': 0.1}
7979

8080
rawTx = self.nodes[0].createrawtransaction(inputs, outputs)
81+
82+
# Make sure decoderawtransaction is at least marginally sane
83+
decodedRawTx = self.nodes[0].decoderawtransaction(rawTx)
84+
for i, inp in enumerate(inputs):
85+
assert_equal(decodedRawTx["vin"][i]["txid"], inp["txid"])
86+
assert_equal(decodedRawTx["vin"][i]["vout"], inp["vout"])
87+
88+
# Make sure decoderawtransaction throws if there is extra data
89+
assert_raises(JSONRPCException, self.nodes[0].decoderawtransaction, rawTx + "00")
90+
8191
rawTxSigned = self.nodes[0].signrawtransaction(rawTx, scripts, privKeys)
8292

8393
# 3) The transaction has no complete set of signatures

0 commit comments

Comments
 (0)