aboutsummaryrefslogtreecommitdiff
path: root/src/test/transaction_tests.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-03-31 14:51:29 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2016-06-22 15:43:00 +0200
commit0ef1dd3e11dd573b6e443852ef0c72e34093ac68 (patch)
tree5fb4e54e732902ea296636877f2cd81dfd4f4b29 /src/test/transaction_tests.cpp
parentb8a97498df1e83f8dcc49bc3fa4344f9e9799242 (diff)
Refactor script validation to observe amounts
This is a preparation for BIP143 support.
Diffstat (limited to 'src/test/transaction_tests.cpp')
-rw-r--r--src/test/transaction_tests.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp
index 9a24a613e5..9fb23d8edf 100644
--- a/src/test/transaction_tests.cpp
+++ b/src/test/transaction_tests.cpp
@@ -149,9 +149,10 @@ BOOST_AUTO_TEST_CASE(tx_valid)
break;
}
+ CAmount amount = 0;
unsigned int verify_flags = ParseScriptFlags(test[2].get_str());
BOOST_CHECK_MESSAGE(VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout],
- NULL, verify_flags, TransactionSignatureChecker(&tx, i), &err),
+ NULL, verify_flags, TransactionSignatureChecker(&tx, i, amount), &err),
strTest);
BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));
}
@@ -224,8 +225,9 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
}
unsigned int verify_flags = ParseScriptFlags(test[2].get_str());
+ CAmount amount = 0;
fValid = VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout],
- NULL, verify_flags, TransactionSignatureChecker(&tx, i), &err);
+ NULL, verify_flags, TransactionSignatureChecker(&tx, i, amount), &err);
}
BOOST_CHECK_MESSAGE(!fValid, strTest);
BOOST_CHECK_MESSAGE(err != SCRIPT_ERR_OK, ScriptErrorString(err));