New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Test Suite] Fix test for null tx input #6863
Conversation
utACK |
From @gmaxwell on IRC: Personally I would have put the 0100 input in the first position, for fear that some coinbase checking code only checks the nullness of the first input. |
utACK I'd test both first and second being the null. :) |
Sounds like a reasonable plan! ;) I'll update the patch accordingly later today. |
4cbbac5
to
3a6f1c5
Compare
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.
3a6f1c5
to
0be387a
Compare
Pushed the extended patch. |
utACK |
ut ACK |
The new test contains a much more structured transaction only. Is there a reason to delete the previous one? |
The previous test didn't do what it was advertised to do - it failed not because of the null txin but because of the coinbase length restriction. This is already tested by the preceding test, so I don't see much of a point in having two tests for that. But if you think it should stay, I can leave it in (but "fix" the comment for what it really tests). |
0be387a unittest: fix test for null tx input (Daniel Kraft)
Adapt some of the existing and failing unit tests to the changed parameters of Huntercoin. Not yet updated and still failing are many name tests. Also one of the transaction tests is still failing, but this seems to be related to a wrongly written test itself, see bitcoin/bitcoin#6863. Trying to get this merged upstream instead of a custom fix here. Furthermore, there are not yet any actual unit tests written newly for Huntercoin or game logic in general.
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. Github-Pull: bitcoin#6863 Rebased-From: 0be387a
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. Github-Pull: bitcoin#6863 Rebased-From: 0be387a
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
. If this check is disabled there inmain.cpp
, the old unittest still succeeded. It does no longer succeed with this patch.