diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2012-09-18 19:22:40 -0400 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2012-09-18 19:22:40 -0400 |
commit | 6cbae37667f504d9ecd6173e1eff817d2b7aaf0c (patch) | |
tree | 541264859661d8400b6644b8fc68896a463d2ea1 /src/test/transaction_tests.cpp | |
parent | b1d3e95a0a9f51e81c82b58ff818a4c236e48e30 (diff) | |
parent | 65786afb0571eb197526f8ada8c8372fbc09b451 (diff) |
Merge branch 'testdata' of git://github.com/TheBlueMatt/bitcoin
Diffstat (limited to 'src/test/transaction_tests.cpp')
-rw-r--r-- | src/test/transaction_tests.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index de6e18f14d..c230458866 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -66,6 +66,8 @@ BOOST_AUTO_TEST_CASE(tx_valid) CTransaction tx; stream >> tx; + BOOST_CHECK_MESSAGE(tx.CheckTransaction(), strTest); + for (unsigned int i = 0; i < tx.vin.size(); i++) { if (!mapprevOutScriptPubKeys.count(tx.vin[i].prevout)) @@ -131,7 +133,9 @@ BOOST_AUTO_TEST_CASE(tx_invalid) CTransaction tx; stream >> tx; - for (unsigned int i = 0; i < tx.vin.size(); i++) + fValid = tx.CheckTransaction(); + + for (unsigned int i = 0; i < tx.vin.size() && fValid; i++) { if (!mapprevOutScriptPubKeys.count(tx.vin[i].prevout)) { @@ -139,8 +143,10 @@ BOOST_AUTO_TEST_CASE(tx_invalid) break; } - BOOST_CHECK_MESSAGE(!VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], tx, i, test[2].get_bool(), 0), strTest); + fValid = VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], tx, i, test[2].get_bool(), 0); } + + BOOST_CHECK_MESSAGE(!fValid, strTest); } } } |