Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jonasschnelli committed May 18, 2015
1 parent 458fb4c commit 2a3126c
Show file tree
Hide file tree
Showing 35 changed files with 210 additions and 2,185 deletions.
12 changes: 0 additions & 12 deletions src/Makefile.am
Expand Up @@ -150,17 +150,6 @@ BITCOIN_CORE_H = \
compat/endian.h \
compat/sanity.h

JSON_H = \
json/json_spirit.h \
json/json_spirit_error_position.h \
json/json_spirit_reader.h \
json/json_spirit_reader_template.h \
json/json_spirit_stream_reader.h \
json/json_spirit_utils.h \
json/json_spirit_value.h \
json/json_spirit_writer.h \
json/json_spirit_writer_template.h

obj/build.h: FORCE
@$(MKDIR_P) $(builddir)/obj
@$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
Expand Down Expand Up @@ -195,7 +184,6 @@ libbitcoin_server_a_SOURCES = \
txdb.cpp \
txmempool.cpp \
validationinterface.cpp \
$(JSON_H) \
$(BITCOIN_CORE_H)

# wallet: shared between bitcoind and bitcoin-qt, but only linked
Expand Down
11 changes: 6 additions & 5 deletions src/bitcoin-cli.cpp
Expand Up @@ -12,8 +12,9 @@

#include <boost/filesystem/operations.hpp>

#include "univalue/univalue.h"

using namespace std;
using namespace json_spirit;

std::string HelpMessageCli()
{
Expand Down Expand Up @@ -94,7 +95,7 @@ static bool AppInitRPC(int argc, char* argv[])
return true;
}

UniValue CallRPC(const string& strMethod, const Array& params)
UniValue CallRPC(const string& strMethod, const UniValue& params)
{
if (mapArgs["-rpcuser"] == "" && mapArgs["-rpcpassword"] == "")
throw runtime_error(strprintf(
Expand Down Expand Up @@ -145,7 +146,7 @@ UniValue CallRPC(const string& strMethod, const Array& params)
UniValue valReply(UniValue::VSTR);
if (!valReply.read(strReply))
throw runtime_error("couldn't parse reply from server");
const Object& reply = valReply.get_obj();
const UniValue& reply = valReply.get_obj();
if (reply.empty())
throw runtime_error("expected reply to have result, error and id properties");

Expand Down Expand Up @@ -179,8 +180,8 @@ int CommandLineRPC(int argc, char *argv[])
const UniValue reply = CallRPC(strMethod, params);

// Parse reply
const Value& result = find_value(reply, "result");
const Value& error = find_value(reply, "error");
const UniValue& result = find_value(reply, "result");
const UniValue& error = find_value(reply, "error");

if (!error.isNull()) {
// Error
Expand Down
24 changes: 0 additions & 24 deletions src/json/LICENSE.txt

This file was deleted.

18 changes: 0 additions & 18 deletions src/json/json_spirit.h

This file was deleted.

54 changes: 0 additions & 54 deletions src/json/json_spirit_error_position.h

This file was deleted.

137 changes: 0 additions & 137 deletions src/json/json_spirit_reader.cpp

This file was deleted.

62 changes: 0 additions & 62 deletions src/json/json_spirit_reader.h

This file was deleted.

0 comments on commit 2a3126c

Please sign in to comment.