MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ParseScriptFlags

Function ParseScriptFlags

src/test/transaction_tests.cpp:57–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55static const std::map<std::string, script_verify_flag_name>& mapFlagNames = ScriptFlagNamesToEnum();
56
57script_verify_flags ParseScriptFlags(std::string strFlags)
58{
59 script_verify_flags flags = SCRIPT_VERIFY_NONE;
60 if (strFlags.empty() || strFlags == "NONE") return flags;
61
62 std::vector<std::string> words = SplitString(strFlags, ',');
63 for (const std::string& word : words)
64 {
65 if (!mapFlagNames.contains(word)) {
66 BOOST_ERROR("Bad test: unknown verification flag '" << word << "'");
67 continue;
68 }
69 flags |= mapFlagNames.at(word);
70 }
71 return flags;
72}
73
74// Check that all flags in STANDARD_SCRIPT_VERIFY_FLAGS are present in mapFlagNames.
75bool CheckMapFlagNames()

Callers 3

AssetTestFunction · 0.70
BOOST_AUTO_TEST_CASEFunction · 0.70
BOOST_AUTO_TEST_CASEFunction · 0.70

Calls 4

SplitStringFunction · 0.85
emptyMethod · 0.45
containsMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected