Changeset View
Changeset View
Standalone View
Standalone View
src/test/sigcheckcount_tests.cpp
Show First 20 Lines • Show All 329 Lines • ▼ Show 20 Lines | |||||
BOOST_AUTO_TEST_CASE(test_verifyscript) { | BOOST_AUTO_TEST_CASE(test_verifyscript) { | ||||
// make sure that verifyscript is correctly resetting and accumulating | // make sure that verifyscript is correctly resetting and accumulating | ||||
// sigchecks for the input. | // sigchecks for the input. | ||||
// Simplest example | // Simplest example | ||||
CHECK_VERIFYSCRIPT(CScript() << OP_1, CScript(), SCRIPT_VERIFY_NONE, 0); | CHECK_VERIFYSCRIPT(CScript() << OP_1, CScript(), SCRIPT_VERIFY_NONE, 0); | ||||
// Common example | // Common example | ||||
CHECK_VERIFYSCRIPT(CScript() << sigschnorr, CScript() << pub << OP_CHECKSIG, | CHECK_VERIFYSCRIPT(CScript() << txsigschnorr, | ||||
SCRIPT_VERIFY_NONE, 1); | CScript() << pub << OP_CHECKSIG, SCRIPT_VERIFY_NONE, 1); | ||||
// Correct behaviour occurs for segwit recovery special case (which returns | // Correct behaviour occurs for segwit recovery special case (which returns | ||||
// success from an alternative location) | // success from an alternative location) | ||||
CScript swscript; | CScript swscript; | ||||
swscript << OP_0 << std::vector<uint8_t>(20); | swscript << OP_0 << std::vector<uint8_t>(20); | ||||
CHECK_VERIFYSCRIPT(CScript() << ToByteVector(swscript), | CHECK_VERIFYSCRIPT(CScript() << ToByteVector(swscript), | ||||
CScript() | CScript() | ||||
<< OP_HASH160 << ToByteVector(CScriptID(swscript)) | << OP_HASH160 << ToByteVector(CScriptID(swscript)) | ||||
Show All 15 Lines |