mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
remove JSON Spirit UniValue wrapper
This commit is contained in:
@@ -30,7 +30,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)
|
||||
@@ -90,7 +90,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)));
|
||||
|
||||
<<<<<<< HEAD
|
||||
ScriptError err;
|
||||
@@ -101,7 +101,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.
|
||||
@@ -113,7 +113,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];
|
||||
@@ -122,7 +122,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;
|
||||
@@ -173,7 +173,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)));
|
||||
|
||||
<<<<<<< HEAD
|
||||
ScriptError err;
|
||||
@@ -184,7 +184,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.
|
||||
@@ -196,7 +196,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];
|
||||
@@ -205,7 +205,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;
|
||||
|
||||
Reference in New Issue
Block a user