Changeset View
Changeset View
Standalone View
Standalone View
src/test/jsonutil.cpp
// Copyright (c) 2018 The Bitcoin developers | // Copyright (c) 2018-2019 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <test/jsonutil.h> | #include <test/jsonutil.h> | ||||
#include <boost/test/unit_test.hpp> | #include <boost/test/unit_test.hpp> | ||||
UniValue read_json(const std::string &jsondata) { | UniValue read_json(const std::string &jsondata) { | ||||
UniValue v; | UniValue v; | ||||
if (!v.read(jsondata) || !v.isArray()) { | if (!v.read(jsondata) || !v.isArray()) { | ||||
BOOST_ERROR("Parse error."); | BOOST_ERROR("Parse error."); | ||||
return UniValue(UniValue::VARR); | return UniValue(UniValue::VARR); | ||||
} | } | ||||
return v.get_array(); | return v.get_array(); | ||||
} | } |