MCPcopy Create free account
hub / github.com/ElementsProject/elements / ParseScriptFlags

Function ParseScriptFlags

src/test/fuzz/script_assets_test_minimizer.cpp:128–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126const std::vector<unsigned int> ALL_FLAGS = AllFlags();
127
128unsigned int ParseScriptFlags(const std::string& str)
129{
130 if (str.empty()) return 0;
131
132 unsigned int flags = 0;
133 std::vector<std::string> words;
134 boost::algorithm::split(words, str, boost::algorithm::is_any_of(","));
135
136 for (const std::string& word : words) {
137 auto it = FLAG_NAMES.find(word);
138 if (it == FLAG_NAMES.end()) throw std::runtime_error("Unknown verification flag " + word);
139 flags |= it->second;
140 }
141
142 return flags;
143}
144
145void Test(const std::string& str)
146{

Callers 1

TestFunction · 0.70

Calls 3

findMethod · 0.80
emptyMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected