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

Function GetKeyOriginData

src/test/descriptor_tests.cpp:110–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110std::set<std::pair<CPubKey, KeyOriginInfo>> GetKeyOriginData(const FlatSigningProvider& provider, int flags) {
111 std::set<std::pair<CPubKey, KeyOriginInfo>> ret;
112 for (const auto& [_, data] : provider.origins) {
113 if (flags & XONLY_KEYS) {
114 unsigned char bytes[33];
115 BOOST_CHECK_EQUAL(data.first.size(), 33);
116 std::copy(data.first.begin(), data.first.end(), bytes);
117 bytes[0] = 0x02;
118 CPubKey norm_pubkey{bytes};
119 KeyOriginInfo norm_origin = data.second;
120 std::fill(std::begin(norm_origin.fingerprint), std::end(norm_origin.fingerprint), 0); // fingerprints don't necessarily match.
121 ret.emplace(norm_pubkey, norm_origin);
122 } else {
123 ret.insert(data);
124 }
125 }
126 return ret;
127}
128
129void DoCheck(const std::string& prv, const std::string& pub, const std::string& norm_prv, const std::string& norm_pub, int flags, const std::vector<std::vector<std::string>>& scripts, const std::optional<OutputType>& type, const std::set<std::vector<uint32_t>>& paths = ONLY_EMPTY,
130 bool replace_apostrophe_with_h_in_prv=false, bool replace_apostrophe_with_h_in_pub=false)

Callers 1

DoCheckFunction · 0.85

Calls 6

beginFunction · 0.85
endFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected