mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
test, build: Separate read_json function into its own module
This commit is contained in:
parent
835212cd1d
commit
7a820cee0e
8 changed files with 38 additions and 21 deletions
|
|
@ -15,6 +15,7 @@
|
|||
#include <script/sign.h>
|
||||
#include <script/signingprovider.h>
|
||||
#include <streams.h>
|
||||
#include <test/util/json.h>
|
||||
#include <test/util/setup_common.h>
|
||||
#include <test/util/transaction_utils.h>
|
||||
#include <util/strencodings.h>
|
||||
|
|
@ -41,18 +42,6 @@ static const unsigned int gFlags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC;
|
|||
unsigned int ParseScriptFlags(std::string strFlags);
|
||||
std::string FormatScriptFlags(unsigned int flags);
|
||||
|
||||
UniValue read_json(const std::string& jsondata)
|
||||
{
|
||||
UniValue v;
|
||||
|
||||
if (!v.read(jsondata) || !v.isArray())
|
||||
{
|
||||
BOOST_ERROR("Parse error.");
|
||||
return UniValue(UniValue::VARR);
|
||||
}
|
||||
return v.get_array();
|
||||
}
|
||||
|
||||
struct ScriptErrorDesc
|
||||
{
|
||||
ScriptError_t err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue