Update sighash tests for new consensus rule

This commit is contained in:
Jack Grigg 2016-10-22 11:09:07 -05:00
parent 7ac924cdb7
commit f4f1b4b097
No known key found for this signature in database
GPG Key ID: 6A6914DAFBEA00DA
1 changed files with 8 additions and 2 deletions

View File

@ -237,8 +237,14 @@ BOOST_AUTO_TEST_CASE(sighash_from_data)
stream >> tx;
CValidationState state;
BOOST_CHECK_MESSAGE(CheckTransactionWithoutProofVerification(tx, state), strTest);
BOOST_CHECK(state.IsValid());
if (tx.nVersion < MIN_TX_VERSION) {
// Transaction must be invalid
BOOST_CHECK_MESSAGE(!CheckTransactionWithoutProofVerification(tx, state), strTest);
BOOST_CHECK(!state.IsValid());
} else {
BOOST_CHECK_MESSAGE(CheckTransactionWithoutProofVerification(tx, state), strTest);
BOOST_CHECK(state.IsValid());
}
std::vector<unsigned char> raw = ParseHex(raw_script);
scriptCode.insert(scriptCode.end(), raw.begin(), raw.end());