MCPcopy Create free account
hub / github.com/LUX-Core/lux / JSONPrettyPrint

Function JSONPrettyPrint

src/test/script_tests.cpp:478–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 3

replaceMethod · 0.80
writeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected