mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-04 06:12:07 +01:00
Backport of some of BIP66's tests
This commit is contained in:
@@ -142,8 +142,13 @@ BOOST_AUTO_TEST_CASE(script_valid)
|
||||
string scriptPubKeyString = test[1].get_str();
|
||||
CScript scriptPubKey = ParseScript(scriptPubKeyString);
|
||||
|
||||
int flagsNow = flags;
|
||||
if (test.size() > 3 && ("," + test[2].get_str() + ",").find(",DERSIG,") != string::npos) {
|
||||
flagsNow |= SCRIPT_VERIFY_DERSIG;
|
||||
}
|
||||
|
||||
CTransaction tx;
|
||||
BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, tx, 0, flags, SIGHASH_NONE), strTest);
|
||||
BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, tx, 0, flagsNow, SIGHASH_NONE), strTest);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,8 +171,13 @@ BOOST_AUTO_TEST_CASE(script_invalid)
|
||||
string scriptPubKeyString = test[1].get_str();
|
||||
CScript scriptPubKey = ParseScript(scriptPubKeyString);
|
||||
|
||||
int flagsNow = flags;
|
||||
if (test.size() > 3 && ("," + test[2].get_str() + ",").find(",DERSIG,") != string::npos) {
|
||||
flagsNow |= SCRIPT_VERIFY_DERSIG;
|
||||
}
|
||||
|
||||
CTransaction tx;
|
||||
BOOST_CHECK_MESSAGE(!VerifyScript(scriptSig, scriptPubKey, tx, 0, flags, SIGHASH_NONE), strTest);
|
||||
BOOST_CHECK_MESSAGE(!VerifyScript(scriptSig, scriptPubKey, tx, 0, flagsNow, SIGHASH_NONE), strTest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user