Changeset View
Changeset View
Standalone View
Standalone View
src/test/sigcheckcount_tests.cpp
Show First 20 Lines • Show All 328 Lines • ▼ Show 20 Lines | #define CHECK_VERIFYSCRIPT(scriptSig, scriptPubKey, flags, expected_sigchecks) \ | ||||
// 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() << sigschnorr, CScript() << pub << OP_CHECKSIG, | ||||
SCRIPT_VERIFY_NONE, 1); | SCRIPT_VERIFY_NONE, 1); | ||||
// Correct behaviour occurs for segwit recovery special case (which returns | // Correct behaviour occurs for segwit recovery special case (which used to | ||||
// success from an alternative location) | // return 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)) | ||||
<< OP_EQUAL, | << OP_EQUAL, | ||||
SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_CLEANSTACK, 0); | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_CLEANSTACK, 0); | ||||
Show All 12 Lines |