aboutsummaryrefslogtreecommitdiff
path: root/src/test/transaction_tests.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <jonas.schnelli@include7.ch>2015-05-18 14:02:18 +0200
committerJonas Schnelli <jonas.schnelli@include7.ch>2015-06-04 09:16:21 +0200
commit9a8897f4ac992741e153d88b54bd2cde877c713d (patch)
treee827981679708bae6bef1516d69efda3524b719f /src/test/transaction_tests.cpp
parent3df0411ad9fd75fb27af53e44835d41f5480fe3f (diff)
downloadbitcoin-9a8897f4ac992741e153d88b54bd2cde877c713d.tar.xz
Remove JSON Spirit wrapper, remove JSON Spirit leftovers
- implement find_value() function for UniValue - replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper - remove JSON Spirit sources
Diffstat (limited to 'src/test/transaction_tests.cpp')
-rw-r--r--src/test/transaction_tests.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp
index afd2d74013..4cfdec1267 100644
--- a/src/test/transaction_tests.cpp
+++ b/src/test/transaction_tests.cpp
@@ -24,10 +24,9 @@
#include <boost/test/unit_test.hpp>
#include <boost/assign/list_of.hpp>
-#include "json_spirit_wrapper.h"
+#include "univalue/univalue.h"
using namespace std;
-using namespace json_spirit;
// In script_tests.cpp
extern UniValue read_json(const std::string& jsondata);
@@ -92,19 +91,11 @@ BOOST_AUTO_TEST_CASE(tx_valid)
// verifyFlags is a comma separated list of script verification flags to apply, or "NONE"
UniValue tests = read_json(std::string(json_tests::tx_valid, json_tests::tx_valid + sizeof(json_tests::tx_valid)));
-<<<<<<< HEAD
ScriptError err;
- BOOST_FOREACH(Value& tv, tests)
- {
- Array test = tv.get_array();
- string strTest = write_string(tv, false);
- if (test[0].type() == array_type)
-=======
for (unsigned int idx = 0; idx < tests.size(); idx++) {
UniValue test = tests[idx];
string strTest = test.write();
if (test[0].isArray())
->>>>>>> Convert tree to using univalue. Eliminate all json_spirit uses.
{
if (test.size() != 3 || !test[1].isStr() || !test[2].isStr())
{
@@ -116,7 +107,7 @@ BOOST_AUTO_TEST_CASE(tx_valid)
UniValue inputs = test[0].get_array();
bool fValid = true;
for (unsigned int inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {
- const Value& input = inputs[inpIdx];
+ const UniValue& input = inputs[inpIdx];
if (!input.isArray())
{
fValid = false;
@@ -175,19 +166,11 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
// verifyFlags is a comma separated list of script verification flags to apply, or "NONE"
UniValue tests = read_json(std::string(json_tests::tx_invalid, json_tests::tx_invalid + sizeof(json_tests::tx_invalid)));
-<<<<<<< HEAD
ScriptError err;
- BOOST_FOREACH(Value& tv, tests)
- {
- Array test = tv.get_array();
- string strTest = write_string(tv, false);
- if (test[0].type() == array_type)
-=======
for (unsigned int idx = 0; idx < tests.size(); idx++) {
UniValue test = tests[idx];
string strTest = test.write();
if (test[0].isArray())
->>>>>>> Convert tree to using univalue. Eliminate all json_spirit uses.
{
if (test.size() != 3 || !test[1].isStr() || !test[2].isStr())
{
@@ -199,7 +182,7 @@ BOOST_AUTO_TEST_CASE(tx_invalid)
UniValue inputs = test[0].get_array();
bool fValid = true;
for (unsigned int inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {
- const Value& input = inputs[inpIdx];
+ const UniValue& input = inputs[inpIdx];
if (!input.isArray())
{
fValid = false;