Skip to content

Conversation

@laanwj
Copy link
Member

@laanwj laanwj commented Feb 11, 2016

Check the returned script_error. Add expected script_error for generated as well as custom tests.

The specific error is not part of consensus, however it could avoid unclear reporting issues such as #6862 in the future. It also makes it easier to verify that all potential error conditions are checked.

It also reveals that overflow conditions return UNKNOWN_ERROR, there appears to be no specific error code for that.

Fixes #7513.

Changes are best reviewed using git --word-diff.

This test was introduced in 9fadf1c,
but accidentally added in the autogenerated area.
@laanwj laanwj added the Tests label Feb 11, 2016
@laanwj laanwj force-pushed the 2016_02_test_script_errors branch from f17716e to 9694b67 Compare February 11, 2016 15:54
@laanwj
Copy link
Member Author

laanwj commented Feb 11, 2016

These are not returned in any of the script tests:

  • SCRIPT_ERR_CHECKMULTISIGVERIFY (OP_CHECKMULTISIGVERIFY)
  • SCRIPT_ERR_CHECKSIGVERIFY (OP_CHECKSIGVERIFY)
  • SCRIPT_ERR_NUMEQUALVERIFY (OP_NUMEQUALVERIFY)
  • SCRIPT_ERR_NEGATIVE_LOCKTIME (OP_CHECKLOCKTIMEVERIFY - BIP65)
  • SCRIPT_ERR_UNSATISFIED_LOCKTIME (OP_CHECKLOCKTIMEVERIFY - BIP65)

Check the returned script_error. Add expected script_error
for generated as well as custom tests.

The specific error is not part of consensus, however
it could avoid unclear reporting issues such as bitcoin#6862 in the future.

Fixes bitcoin#7513.
@laanwj laanwj force-pushed the 2016_02_test_script_errors branch from 9694b67 to 0ecb340 Compare February 11, 2016 16:33
@laanwj
Copy link
Member Author

laanwj commented Mar 1, 2016

Ping @cfields @sipa @gmaxwell

@laanwj laanwj closed this Mar 2, 2016
@theuni
Copy link
Member

theuni commented Mar 3, 2016

@laanwj Closed on purpose? I didn't see this before, but sounds like a good idea for sure.

@laanwj
Copy link
Member Author

laanwj commented Mar 3, 2016

@theuni Closed because I've been asking for review a few times for this, but never received any answer (neither positive nor negative) so I was assuming it was too much review work relative to some extra testing coverage.

Happy to reopen though!

@laanwj laanwj reopened this Mar 3, 2016
@laanwj laanwj merged commit 0ecb340 into bitcoin:master Mar 14, 2016
laanwj added a commit that referenced this pull request Mar 14, 2016
0ecb340 test: Script_error checking in script_invalid tests (Wladimir J. van der Laan)
2317ad7 test: Re-introduce JSON pretty printing in test builder (Wladimir J. van der Laan)
b0ff857 test: Move non-generated script_invalid test to the correct place (Wladimir J. van der Laan)
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request May 4, 2016
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify script errors as part of tx_invalid tests

3 participants