Changeset View
Changeset View
Standalone View
Standalone View
src/test/script_tests.cpp
Show First 20 Lines • Show All 407 Lines • ▼ Show 20 Lines | UniValue GetJSON() { | ||||
array.push_back(FormatScript(spendTx.vin[0].scriptSig)); | array.push_back(FormatScript(spendTx.vin[0].scriptSig)); | ||||
array.push_back(FormatScript(creditTx->vout[0].scriptPubKey)); | array.push_back(FormatScript(creditTx->vout[0].scriptPubKey)); | ||||
array.push_back(FormatScriptFlags(flags)); | array.push_back(FormatScriptFlags(flags)); | ||||
array.push_back(FormatScriptError((ScriptError_t)scriptError)); | array.push_back(FormatScriptError((ScriptError_t)scriptError)); | ||||
array.push_back(comment); | array.push_back(comment); | ||||
return array; | return array; | ||||
} | } | ||||
std::string GetComment() { return comment; } | std::string GetComment() const { return comment; } | ||||
}; | }; | ||||
std::string JSONPrettyPrint(const UniValue &univalue) { | std::string JSONPrettyPrint(const UniValue &univalue) { | ||||
std::string ret = univalue.write(4); | std::string ret = univalue.write(4); | ||||
// Workaround for libunivalue pretty printer, which puts a space between | // Workaround for libunivalue pretty printer, which puts a space between | ||||
// commas and newlines | // commas and newlines | ||||
size_t pos = 0; | size_t pos = 0; | ||||
while ((pos = ret.find(" \n", pos)) != std::string::npos) { | while ((pos = ret.find(" \n", pos)) != std::string::npos) { | ||||
▲ Show 20 Lines • Show All 1,645 Lines • Show Last 20 Lines |