Add sighash tests from data file#3975
Conversation
|
btw: the new test data was generated using the existing previous test, by adding a few lines that printed the needed data. |
There was a problem hiding this comment.
Perhaps catch and report deserialization errors here?
|
Looks good to me. Would you mind including the code that was used to generate these tests (perhaps in an #if 0'ed block in sighash_tests.cpp)? |
|
ACK |
|
updated with fixes suggested by @sipa |
|
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/81bfb5aebf983f999d3de12ca4adf8cd4c4a8ae0 for binaries and test log. |
|
ACK |
This adds SignatureHash tests derived from a data file, instead of generating random transactions like the existing test. It allows other libraries (in my case https://github.com/bitpay/bitcore) to import the test vectors knowing they pass in Bitcoin Core. This is my first contribution (and the first C++ code I wrote), so please let me know if it needs corrections.