Skip to content

Commit 0be387a

Browse files
committed
unittest: fix test for null tx input
Update the unittest that is meant to catch a transaction that is invalid because it has a null input. The old test failed not because of that but because it was considered a coinbase with too large script. This is already checked with a different test, though. The new test is *not* a coinbase since it has two inputs, but one of them is null. This really checks the corresponding code path in CheckTransaction.
1 parent 8f3b3cd commit 0be387a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/test/data/tx_invalid.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@
6464
[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]],
6565
"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff655151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151ffffffff010000000000000000015100000000", "P2SH"],
6666

67-
["Null txin"],
68-
[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "HASH160 0x14 0x02dae7dbbda56097959cba59b1989dd3e47937bf EQUAL"]],
69-
"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff6e49304602210086f39e028e46dafa8e1e3be63906465f4cf038fbe5ed6403dc3e74ae876e6431022100c4625c675cfc5c7e3a0e0d7eaec92ac24da20c73a88eb40d09253e51ac6def5201232103a183ddc41e84753aca47723c965d1b5c8b0e2b537963518355e6dd6cf8415e50acffffffff010000000000000000015100000000", "P2SH"],
67+
["Null txin, but without being a coinbase (because there are two inputs)"],
68+
[[["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"],
69+
["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]],
70+
"01000000020000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff010000000000000000015100000000", "P2SH"],
71+
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"],
72+
["0000000000000000000000000000000000000000000000000000000000000000", -1, "1"]],
73+
"010000000200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff010000000000000000015100000000", "P2SH"],
7074

7175
["Same as the transactions in valid with one input SIGHASH_ALL and one SIGHASH_ANYONECANPAY, but we set the _ANYONECANPAY sequence number, invalidating the SIGHASH_ALL signature"],
7276
[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG"],

0 commit comments

Comments
 (0)