@@ -123,7 +123,7 @@ static ScriptError_t ParseScriptError(const std::string& name)
123123
124124BOOST_FIXTURE_TEST_SUITE (script_tests, BasicTestingSetup)
125125
126- void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScriptWitness& scriptWitness, int flags, const std::string& message, int scriptError, CAmount nValue = 0 )
126+ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScriptWitness& scriptWitness, uint32_t flags, const std::string& message, int scriptError, CAmount nValue = 0 )
127127{
128128 bool expect = (scriptError == SCRIPT_ERR_OK);
129129 if (flags & SCRIPT_VERIFY_CLEANSTACK) {
@@ -139,8 +139,8 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScript
139139
140140 // Verify that removing flags from a passing test or adding flags to a failing test does not change the result.
141141 for (int i = 0 ; i < 16 ; ++i) {
142- int extra_flags = InsecureRandBits (16 );
143- int combined_flags = expect ? (flags & ~extra_flags) : (flags | extra_flags);
142+ uint32_t extra_flags ( InsecureRandBits (16 ) );
143+ uint32_t combined_flags{ expect ? (flags & ~extra_flags) : (flags | extra_flags)} ;
144144 // Weed out some invalid flag combinations.
145145 if (combined_flags & SCRIPT_VERIFY_CLEANSTACK && ~combined_flags & (SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS)) continue ;
146146 if (combined_flags & SCRIPT_VERIFY_WITNESS && ~combined_flags & SCRIPT_VERIFY_P2SH) continue ;
@@ -150,7 +150,7 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScript
150150#if defined(HAVE_CONSENSUS_LIB)
151151 CDataStream stream (SER_NETWORK, PROTOCOL_VERSION);
152152 stream << tx2;
153- int libconsensus_flags = flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL;
153+ uint32_t libconsensus_flags{ flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL} ;
154154 if (libconsensus_flags == flags) {
155155 int expectedSuccessCode = expect ? 1 : 0 ;
156156 if (flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS) {
@@ -258,7 +258,7 @@ class TestBuilder
258258 bool havePush;
259259 std::vector<unsigned char > push;
260260 std::string comment;
261- int flags;
261+ uint32_t flags;
262262 int scriptError;
263263 CAmount nValue;
264264
@@ -278,7 +278,7 @@ class TestBuilder
278278 }
279279
280280public:
281- TestBuilder (const CScript& script_, const std::string& comment_, int flags_, bool P2SH = false , WitnessMode wm = WitnessMode::NONE, int witnessversion = 0 , CAmount nValue_ = 0 ) : script(script_), havePush(false ), comment(comment_), flags(flags_), scriptError(SCRIPT_ERR_OK), nValue(nValue_)
281+ TestBuilder (const CScript& script_, const std::string& comment_, uint32_t flags_, bool P2SH = false , WitnessMode wm = WitnessMode::NONE, int witnessversion = 0 , CAmount nValue_ = 0 ) : script(script_), havePush(false ), comment(comment_), flags(flags_), scriptError(SCRIPT_ERR_OK), nValue(nValue_)
282282 {
283283 CScript scriptPubKey = script;
284284 if (wm == WitnessMode::PKH) {
@@ -1677,7 +1677,7 @@ static void AssetTest(const UniValue& test)
16771677 const std::vector<CTxOut> prevouts = TxOutsFromJSON (test[" prevouts" ]);
16781678 BOOST_CHECK (prevouts.size () == mtx.vin .size ());
16791679 size_t idx = test[" index" ].get_int64 ();
1680- unsigned int test_flags = ParseScriptFlags (test[" flags" ].get_str ());
1680+ uint32_t test_flags{ ParseScriptFlags (test[" flags" ].get_str ())} ;
16811681 bool fin = test.exists (" final" ) && test[" final" ].get_bool ();
16821682
16831683 if (test.exists (" success" )) {
0 commit comments