32
32
// Uncomment if you want to output updated JSON tests.
33
33
// #define UPDATE_JSON_TESTS
34
34
35
- static const unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC;
35
+ static const unsigned int gFlags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC;
36
36
37
37
unsigned int ParseScriptFlags (std::string strFlags);
38
38
std::string FormatScriptFlags (unsigned int flags);
@@ -1065,18 +1065,18 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12)
1065
1065
CMutableTransaction txTo12 = BuildSpendingTransaction (CScript (), CScriptWitness (), txFrom12);
1066
1066
1067
1067
CScript goodsig1 = sign_multisig (scriptPubKey12, key1, txTo12);
1068
- BOOST_CHECK (VerifyScript (goodsig1, scriptPubKey12, NULL , flags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1068
+ BOOST_CHECK (VerifyScript (goodsig1, scriptPubKey12, NULL , gFlags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1069
1069
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_OK, ScriptErrorString (err));
1070
1070
txTo12.vout [0 ].nValue = 2 ;
1071
- BOOST_CHECK (!VerifyScript (goodsig1, scriptPubKey12, NULL , flags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1071
+ BOOST_CHECK (!VerifyScript (goodsig1, scriptPubKey12, NULL , gFlags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1072
1072
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1073
1073
1074
1074
CScript goodsig2 = sign_multisig (scriptPubKey12, key2, txTo12);
1075
- BOOST_CHECK (VerifyScript (goodsig2, scriptPubKey12, NULL , flags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1075
+ BOOST_CHECK (VerifyScript (goodsig2, scriptPubKey12, NULL , gFlags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1076
1076
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_OK, ScriptErrorString (err));
1077
1077
1078
1078
CScript badsig1 = sign_multisig (scriptPubKey12, key3, txTo12);
1079
- BOOST_CHECK (!VerifyScript (badsig1, scriptPubKey12, NULL , flags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1079
+ BOOST_CHECK (!VerifyScript (badsig1, scriptPubKey12, NULL , gFlags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1080
1080
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1081
1081
}
1082
1082
@@ -1098,54 +1098,54 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23)
1098
1098
std::vector<CKey> keys;
1099
1099
keys.push_back (key1); keys.push_back (key2);
1100
1100
CScript goodsig1 = sign_multisig (scriptPubKey23, keys, txTo23);
1101
- BOOST_CHECK (VerifyScript (goodsig1, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1101
+ BOOST_CHECK (VerifyScript (goodsig1, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1102
1102
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_OK, ScriptErrorString (err));
1103
1103
1104
1104
keys.clear ();
1105
1105
keys.push_back (key1); keys.push_back (key3);
1106
1106
CScript goodsig2 = sign_multisig (scriptPubKey23, keys, txTo23);
1107
- BOOST_CHECK (VerifyScript (goodsig2, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1107
+ BOOST_CHECK (VerifyScript (goodsig2, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1108
1108
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_OK, ScriptErrorString (err));
1109
1109
1110
1110
keys.clear ();
1111
1111
keys.push_back (key2); keys.push_back (key3);
1112
1112
CScript goodsig3 = sign_multisig (scriptPubKey23, keys, txTo23);
1113
- BOOST_CHECK (VerifyScript (goodsig3, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1113
+ BOOST_CHECK (VerifyScript (goodsig3, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1114
1114
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_OK, ScriptErrorString (err));
1115
1115
1116
1116
keys.clear ();
1117
1117
keys.push_back (key2); keys.push_back (key2); // Can't re-use sig
1118
1118
CScript badsig1 = sign_multisig (scriptPubKey23, keys, txTo23);
1119
- BOOST_CHECK (!VerifyScript (badsig1, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1119
+ BOOST_CHECK (!VerifyScript (badsig1, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1120
1120
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1121
1121
1122
1122
keys.clear ();
1123
1123
keys.push_back (key2); keys.push_back (key1); // sigs must be in correct order
1124
1124
CScript badsig2 = sign_multisig (scriptPubKey23, keys, txTo23);
1125
- BOOST_CHECK (!VerifyScript (badsig2, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1125
+ BOOST_CHECK (!VerifyScript (badsig2, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1126
1126
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1127
1127
1128
1128
keys.clear ();
1129
1129
keys.push_back (key3); keys.push_back (key2); // sigs must be in correct order
1130
1130
CScript badsig3 = sign_multisig (scriptPubKey23, keys, txTo23);
1131
- BOOST_CHECK (!VerifyScript (badsig3, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1131
+ BOOST_CHECK (!VerifyScript (badsig3, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1132
1132
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1133
1133
1134
1134
keys.clear ();
1135
1135
keys.push_back (key4); keys.push_back (key2); // sigs must match pubkeys
1136
1136
CScript badsig4 = sign_multisig (scriptPubKey23, keys, txTo23);
1137
- BOOST_CHECK (!VerifyScript (badsig4, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1137
+ BOOST_CHECK (!VerifyScript (badsig4, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1138
1138
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1139
1139
1140
1140
keys.clear ();
1141
1141
keys.push_back (key1); keys.push_back (key4); // sigs must match pubkeys
1142
1142
CScript badsig5 = sign_multisig (scriptPubKey23, keys, txTo23);
1143
- BOOST_CHECK (!VerifyScript (badsig5, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1143
+ BOOST_CHECK (!VerifyScript (badsig5, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1144
1144
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1145
1145
1146
1146
keys.clear (); // Must have signatures
1147
1147
CScript badsig6 = sign_multisig (scriptPubKey23, keys, txTo23);
1148
- BOOST_CHECK (!VerifyScript (badsig6, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1148
+ BOOST_CHECK (!VerifyScript (badsig6, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1149
1149
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_INVALID_STACK_OPERATION, ScriptErrorString (err));
1150
1150
}
1151
1151
0 commit comments