diff options
| author | Thomas Kerin <[email protected]> | 2016-01-24 16:29:39 +0000 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-06-22 15:43:00 +0200 |
| commit | b7dbeb24ebff16198b2925d906c06771e167bd9e (patch) | |
| tree | a20dd281b3356bd7b74df96480a687aac430f1e3 /src/test/script_tests.cpp | |
| parent | BIP141: Other consensus critical limits, and BIP145 (diff) | |
| download | discoin-b7dbeb24ebff16198b2925d906c06771e167bd9e.tar.xz discoin-b7dbeb24ebff16198b2925d906c06771e167bd9e.zip | |
[libconsensus] Script verification API with amounts
script_tests: always test bitcoinconsensus_verify_script_with_amount if VERIFY_WITNESS isn't set
Rename internal method + make it static
trim bitcoinconsensus_ prefix
Add SERIALIZE_TRANSACTION_WITNESS flag
Diffstat (limited to 'src/test/script_tests.cpp')
| -rw-r--r-- | src/test/script_tests.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index c56b9da4e..7fd7614e2 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -160,7 +160,12 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, int flags, co #if defined(HAVE_CONSENSUS_LIB) CDataStream stream(SER_NETWORK, PROTOCOL_VERSION); stream << tx2; - BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script(begin_ptr(scriptPubKey), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect,message); + if (flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS) { + BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(begin_ptr(scriptPubKey), scriptPubKey.size(), amountZero, (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect, message); + } else { + BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(begin_ptr(scriptPubKey), scriptPubKey.size(), 0, (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect, message); + BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script(begin_ptr(scriptPubKey), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect,message); + } #endif } |