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

Function GetKeyOriginData

src/test/descriptor_tests.cpp:142–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142std::set<std::pair<CPubKey, KeyOriginInfo>> GetKeyOriginData(const FlatSigningProvider& provider, int flags) {
143 std::set<CKeyID> ignored;
144 if (flags & MUSIG) {
145 for (const auto& [_, part_pks] : provider.aggregate_pubkeys) {
146 for (const auto& pk : part_pks) {
147 ignored.insert(pk.GetID());
148 }
149 }
150 }
151
152 std::set<std::pair<CPubKey, KeyOriginInfo>> ret;
153 for (const auto& [keyid, data] : provider.origins) {
154 if (ignored.contains(keyid)) continue;
155 if (flags & XONLY_KEYS) {
156 unsigned char bytes[33];
157 BOOST_CHECK_EQUAL(data.first.size(), 33);
158 std::copy(data.first.begin(), data.first.end(), bytes);
159 bytes[0] = 0x02;
160 CPubKey norm_pubkey{bytes};
161 KeyOriginInfo norm_origin = data.second;
162 std::fill(std::begin(norm_origin.fingerprint), std::end(norm_origin.fingerprint), 0); // fingerprints don't necessarily match.
163 ret.emplace(norm_pubkey, norm_origin);
164 } else {
165 ret.insert(data);
166 }
167 }
168 return ret;
169}
170
171void DoCheck(std::string prv, std::string pub, const std::string& norm_pub, int flags,
172 const std::vector<std::vector<std::string>>& scripts, const std::optional<OutputType>& type, std::optional<uint256> op_desc_id = std::nullopt,

Callers 1

DoCheckFunction · 0.85

Calls 9

beginFunction · 0.85
endFunction · 0.85
emplaceMethod · 0.80
insertMethod · 0.45
GetIDMethod · 0.45
containsMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected