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

Function JSONPrettyPrint

src/test/script_tests.cpp:485–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483};
484
485std::string JSONPrettyPrint(const UniValue& univalue)
486{
487 std::string ret = univalue.write(4);
488 // Workaround for libunivalue pretty printer, which puts a space between commas and newlines
489 size_t pos = 0;
490 while ((pos = ret.find(" \n", pos)) != std::string::npos) {
491 ret.replace(pos, 2, "\n");
492 pos++;
493 }
494 return ret;
495}
496} // namespace
497
498BOOST_AUTO_TEST_CASE(script_build)

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 2

findMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected