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

Function ParseScriptFlags

src/test/fuzz/script_assets_test_minimizer.cpp:130–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

TestFunction · 0.70

Calls 4

SplitStringFunction · 0.85
findMethod · 0.80
emptyMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected