diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2013-01-27 00:14:11 +0100 |
---|---|---|
committer | Pieter Wuille <pieterw@google.com> | 2013-01-30 03:56:44 +0100 |
commit | ef3988ca369900206b0cfc32cc1958aee0e43710 (patch) | |
tree | 9cd1ecf802bd159238ece0954200b98a45d01bf3 /src/test/transaction_tests.cpp | |
parent | 2835080e164527ecc2db31e68d86ab8a8337c62b (diff) |
CValidationState framework
Diffstat (limited to 'src/test/transaction_tests.cpp')
-rw-r--r-- | src/test/transaction_tests.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 23837c6c15..f44d46fdb8 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -66,7 +66,9 @@ BOOST_AUTO_TEST_CASE(tx_valid) CTransaction tx; stream >> tx; - BOOST_CHECK_MESSAGE(tx.CheckTransaction(), strTest); + CValidationState state; + BOOST_CHECK_MESSAGE(tx.CheckTransaction(state), strTest); + BOOST_CHECK(state.IsValid()); for (unsigned int i = 0; i < tx.vin.size(); i++) { @@ -133,7 +135,8 @@ BOOST_AUTO_TEST_CASE(tx_invalid) CTransaction tx; stream >> tx; - fValid = tx.CheckTransaction(); + CValidationState state; + fValid = tx.CheckTransaction(state) && state.IsValid(); for (unsigned int i = 0; i < tx.vin.size() && fValid; i++) { @@ -159,11 +162,12 @@ BOOST_AUTO_TEST_CASE(basic_transaction_tests) CDataStream stream(vch, SER_DISK, CLIENT_VERSION); CTransaction tx; stream >> tx; - BOOST_CHECK_MESSAGE(tx.CheckTransaction(), "Simple deserialized transaction should be valid."); + CValidationState state; + BOOST_CHECK_MESSAGE(tx.CheckTransaction(state) && state.IsValid(), "Simple deserialized transaction should be valid."); // Check that duplicate txins fail tx.vin.push_back(tx.vin[0]); - BOOST_CHECK_MESSAGE(!tx.CheckTransaction(), "Transaction with duplicate txins should be invalid."); + BOOST_CHECK_MESSAGE(!tx.CheckTransaction(state) || !state.IsValid(), "Transaction with duplicate txins should be invalid."); } // |