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);
@@ -1070,18 +1070,18 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12)
1070
1070
CMutableTransaction txTo12 = BuildSpendingTransaction (CScript (), CScriptWitness (), txFrom12);
1071
1071
1072
1072
CScript goodsig1 = sign_multisig (scriptPubKey12, key1, txTo12);
1073
- BOOST_CHECK (VerifyScript (goodsig1, scriptPubKey12, NULL , flags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1073
+ BOOST_CHECK (VerifyScript (goodsig1, scriptPubKey12, NULL , gFlags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1074
1074
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_OK, ScriptErrorString (err));
1075
1075
txTo12.vout [0 ].nValue = 2 ;
1076
- BOOST_CHECK (!VerifyScript (goodsig1, scriptPubKey12, NULL , flags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1076
+ BOOST_CHECK (!VerifyScript (goodsig1, scriptPubKey12, NULL , gFlags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1077
1077
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1078
1078
1079
1079
CScript goodsig2 = sign_multisig (scriptPubKey12, key2, txTo12);
1080
- BOOST_CHECK (VerifyScript (goodsig2, scriptPubKey12, NULL , flags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1080
+ BOOST_CHECK (VerifyScript (goodsig2, scriptPubKey12, NULL , gFlags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1081
1081
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_OK, ScriptErrorString (err));
1082
1082
1083
1083
CScript badsig1 = sign_multisig (scriptPubKey12, key3, txTo12);
1084
- BOOST_CHECK (!VerifyScript (badsig1, scriptPubKey12, NULL , flags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1084
+ BOOST_CHECK (!VerifyScript (badsig1, scriptPubKey12, NULL , gFlags , MutableTransactionSignatureChecker (&txTo12, 0 , txFrom12.vout [0 ].nValue ), &err));
1085
1085
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1086
1086
}
1087
1087
@@ -1103,54 +1103,54 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23)
1103
1103
std::vector<CKey> keys;
1104
1104
keys.push_back (key1); keys.push_back (key2);
1105
1105
CScript goodsig1 = sign_multisig (scriptPubKey23, keys, txTo23);
1106
- BOOST_CHECK (VerifyScript (goodsig1, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1106
+ BOOST_CHECK (VerifyScript (goodsig1, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1107
1107
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_OK, ScriptErrorString (err));
1108
1108
1109
1109
keys.clear ();
1110
1110
keys.push_back (key1); keys.push_back (key3);
1111
1111
CScript goodsig2 = sign_multisig (scriptPubKey23, keys, txTo23);
1112
- BOOST_CHECK (VerifyScript (goodsig2, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1112
+ BOOST_CHECK (VerifyScript (goodsig2, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1113
1113
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_OK, ScriptErrorString (err));
1114
1114
1115
1115
keys.clear ();
1116
1116
keys.push_back (key2); keys.push_back (key3);
1117
1117
CScript goodsig3 = sign_multisig (scriptPubKey23, keys, txTo23);
1118
- BOOST_CHECK (VerifyScript (goodsig3, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1118
+ BOOST_CHECK (VerifyScript (goodsig3, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1119
1119
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_OK, ScriptErrorString (err));
1120
1120
1121
1121
keys.clear ();
1122
1122
keys.push_back (key2); keys.push_back (key2); // Can't re-use sig
1123
1123
CScript badsig1 = sign_multisig (scriptPubKey23, keys, txTo23);
1124
- BOOST_CHECK (!VerifyScript (badsig1, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1124
+ BOOST_CHECK (!VerifyScript (badsig1, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1125
1125
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1126
1126
1127
1127
keys.clear ();
1128
1128
keys.push_back (key2); keys.push_back (key1); // sigs must be in correct order
1129
1129
CScript badsig2 = sign_multisig (scriptPubKey23, keys, txTo23);
1130
- BOOST_CHECK (!VerifyScript (badsig2, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1130
+ BOOST_CHECK (!VerifyScript (badsig2, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1131
1131
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1132
1132
1133
1133
keys.clear ();
1134
1134
keys.push_back (key3); keys.push_back (key2); // sigs must be in correct order
1135
1135
CScript badsig3 = sign_multisig (scriptPubKey23, keys, txTo23);
1136
- BOOST_CHECK (!VerifyScript (badsig3, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1136
+ BOOST_CHECK (!VerifyScript (badsig3, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1137
1137
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1138
1138
1139
1139
keys.clear ();
1140
1140
keys.push_back (key4); keys.push_back (key2); // sigs must match pubkeys
1141
1141
CScript badsig4 = sign_multisig (scriptPubKey23, keys, txTo23);
1142
- BOOST_CHECK (!VerifyScript (badsig4, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1142
+ BOOST_CHECK (!VerifyScript (badsig4, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1143
1143
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1144
1144
1145
1145
keys.clear ();
1146
1146
keys.push_back (key1); keys.push_back (key4); // sigs must match pubkeys
1147
1147
CScript badsig5 = sign_multisig (scriptPubKey23, keys, txTo23);
1148
- BOOST_CHECK (!VerifyScript (badsig5, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1148
+ BOOST_CHECK (!VerifyScript (badsig5, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1149
1149
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString (err));
1150
1150
1151
1151
keys.clear (); // Must have signatures
1152
1152
CScript badsig6 = sign_multisig (scriptPubKey23, keys, txTo23);
1153
- BOOST_CHECK (!VerifyScript (badsig6, scriptPubKey23, NULL , flags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1153
+ BOOST_CHECK (!VerifyScript (badsig6, scriptPubKey23, NULL , gFlags , MutableTransactionSignatureChecker (&txTo23, 0 , txFrom23.vout [0 ].nValue ), &err));
1154
1154
BOOST_CHECK_MESSAGE (err == SCRIPT_ERR_INVALID_STACK_OPERATION, ScriptErrorString (err));
1155
1155
}
1156
1156
0 commit comments