remove JSON Spirit UniValue wrapper

This commit is contained in:
Jonas Schnelli
2015-05-13 21:29:19 +02:00
committed by Jack Grigg
parent 565d26737a
commit 851f58f94e
23 changed files with 255 additions and 274 deletions

View File

@@ -37,7 +37,7 @@ using namespace std;
using namespace json_spirit;
// In script_tests.cpp
extern Array read_json(const std::string& jsondata);
extern UniValue read_json(const std::string& jsondata);
static std::map<string, unsigned int> mapFlagNames = boost::assign::map_list_of
(string("NONE"), (unsigned int)SCRIPT_VERIFY_NONE)
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(tx_valid)
// ... where all scripts are stringified scripts.
//
// verifyFlags is a comma separated list of script verification flags to apply, or "NONE"
Array tests = read_json(std::string(json_tests::tx_valid, json_tests::tx_valid + sizeof(json_tests::tx_valid)));
UniValue tests = read_json(std::string(json_tests::tx_valid, json_tests::tx_valid + sizeof(json_tests::tx_valid)));
auto verifier = libzcash::ProofVerifier::Strict();
<<<<<<< HEAD
@@ -110,7 +110,7 @@ BOOST_AUTO_TEST_CASE(tx_valid)
if (test[0].type() == array_type)
=======
for (unsigned int idx = 0; idx < tests.size(); idx++) {
Array test = tests[idx];
UniValue test = tests[idx];
string strTest = test.write();
if (test[0].isArray())
>>>>>>> Convert tree to using univalue. Eliminate all json_spirit uses.
@@ -122,7 +122,7 @@ BOOST_AUTO_TEST_CASE(tx_valid)
}
map<COutPoint, CScript> mapprevOutScriptPubKeys;
Array inputs = test[0].get_array();
UniValue inputs = test[0].get_array();
bool fValid = true;
for (unsigned int inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {
const Value& input = inputs[inpIdx];
@@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE(tx_valid)
fValid = false;
break;
}
Array vinput = input.get_array();
UniValue vinput = input.get_array();
if (vinput.size() != 3)
{
fValid = false;
@@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
// ... where all scripts are stringified scripts.
//
// verifyFlags is a comma separated list of script verification flags to apply, or "NONE"
Array tests = read_json(std::string(json_tests::tx_invalid, json_tests::tx_invalid + sizeof(json_tests::tx_invalid)));
UniValue tests = read_json(std::string(json_tests::tx_invalid, json_tests::tx_invalid + sizeof(json_tests::tx_invalid)));
auto verifier = libzcash::ProofVerifier::Strict();
<<<<<<< HEAD
@@ -194,7 +194,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
if (test[0].type() == array_type)
=======
for (unsigned int idx = 0; idx < tests.size(); idx++) {
Array test = tests[idx];
UniValue test = tests[idx];
string strTest = test.write();
if (test[0].isArray())
>>>>>>> Convert tree to using univalue. Eliminate all json_spirit uses.
@@ -206,7 +206,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
}
map<COutPoint, CScript> mapprevOutScriptPubKeys;
Array inputs = test[0].get_array();
UniValue inputs = test[0].get_array();
bool fValid = true;
for (unsigned int inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {
const Value& input = inputs[inpIdx];
@@ -215,7 +215,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
fValid = false;
break;
}
Array vinput = input.get_array();
UniValue vinput = input.get_array();
if (vinput.size() != 3)
{
fValid = false;