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

Function Check

src/test/descriptor_tests.cpp:345–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345void Check(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)
346{
347 bool found_apostrophes_in_prv = false;
348 bool found_apostrophes_in_pub = false;
349
350 // Do not replace apostrophes with 'h' in prv and pub
351 DoCheck(prv, pub, norm_prv, norm_pub, flags, scripts, type, paths);
352
353 // Replace apostrophes with 'h' in prv but not in pub, if apostrophes are found in prv
354 if (prv.find('\'') != std::string::npos) {
355 found_apostrophes_in_prv = true;
356 DoCheck(prv, pub, norm_prv, norm_pub, flags, scripts, type, paths, /* replace_apostrophe_with_h_in_prv = */true, /*replace_apostrophe_with_h_in_pub = */false);
357 }
358
359 // Replace apostrophes with 'h' in pub but not in prv, if apostrophes are found in pub
360 if (pub.find('\'') != std::string::npos) {
361 found_apostrophes_in_pub = true;
362 DoCheck(prv, pub, norm_prv, norm_pub, flags, scripts, type, paths, /* replace_apostrophe_with_h_in_prv = */false, /*replace_apostrophe_with_h_in_pub = */true);
363 }
364
365 // Replace apostrophes with 'h' both in prv and in pub, if apostrophes are found in both
366 if (found_apostrophes_in_prv && found_apostrophes_in_pub) {
367 DoCheck(prv, pub, norm_prv, norm_pub, flags, scripts, type, paths, /* replace_apostrophe_with_h_in_prv = */true, /*replace_apostrophe_with_h_in_pub = */true);
368 }
369}
370
371}
372

Callers 14

SetMethod · 0.85
AddMethod · 0.85
GoodMethod · 0.85
AttemptMethod · 0.85
ResolveCollisionsMethod · 0.85
SelectTriedCollisionMethod · 0.85
SelectMethod · 0.85
GetAddrMethod · 0.85
ConnectedMethod · 0.85
SetServicesMethod · 0.85
FindAddressEntryMethod · 0.85
MakeNewKeyMethod · 0.85

Calls 2

DoCheckFunction · 0.85
findMethod · 0.80

Tested by

no test coverage detected