Skip to content

Commit 2a3126c

Browse files
committed
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
1 parent 458fb4c commit 2a3126c

35 files changed

+210
-2185
lines changed

src/Makefile.am

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,6 @@ BITCOIN_CORE_H = \
150150
compat/endian.h \
151151
compat/sanity.h
152152

153-
JSON_H = \
154-
json/json_spirit.h \
155-
json/json_spirit_error_position.h \
156-
json/json_spirit_reader.h \
157-
json/json_spirit_reader_template.h \
158-
json/json_spirit_stream_reader.h \
159-
json/json_spirit_utils.h \
160-
json/json_spirit_value.h \
161-
json/json_spirit_writer.h \
162-
json/json_spirit_writer_template.h
163-
164153
obj/build.h: FORCE
165154
@$(MKDIR_P) $(builddir)/obj
166155
@$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
@@ -195,7 +184,6 @@ libbitcoin_server_a_SOURCES = \
195184
txdb.cpp \
196185
txmempool.cpp \
197186
validationinterface.cpp \
198-
$(JSON_H) \
199187
$(BITCOIN_CORE_H)
200188

201189
# wallet: shared between bitcoind and bitcoin-qt, but only linked

src/bitcoin-cli.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212

1313
#include <boost/filesystem/operations.hpp>
1414

15+
#include "univalue/univalue.h"
16+
1517
using namespace std;
16-
using namespace json_spirit;
1718

1819
std::string HelpMessageCli()
1920
{
@@ -94,7 +95,7 @@ static bool AppInitRPC(int argc, char* argv[])
9495
return true;
9596
}
9697

97-
UniValue CallRPC(const string& strMethod, const Array& params)
98+
UniValue CallRPC(const string& strMethod, const UniValue& params)
9899
{
99100
if (mapArgs["-rpcuser"] == "" && mapArgs["-rpcpassword"] == "")
100101
throw runtime_error(strprintf(
@@ -145,7 +146,7 @@ UniValue CallRPC(const string& strMethod, const Array& params)
145146
UniValue valReply(UniValue::VSTR);
146147
if (!valReply.read(strReply))
147148
throw runtime_error("couldn't parse reply from server");
148-
const Object& reply = valReply.get_obj();
149+
const UniValue& reply = valReply.get_obj();
149150
if (reply.empty())
150151
throw runtime_error("expected reply to have result, error and id properties");
151152

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

181182
// Parse reply
182-
const Value& result = find_value(reply, "result");
183-
const Value& error = find_value(reply, "error");
183+
const UniValue& result = find_value(reply, "result");
184+
const UniValue& error = find_value(reply, "error");
184185

185186
if (!error.isNull()) {
186187
// Error

src/json/LICENSE.txt

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/json/json_spirit.h

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/json/json_spirit_error_position.h

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/json/json_spirit_reader.cpp

Lines changed: 0 additions & 137 deletions
This file was deleted.

src/json/json_spirit_reader.h

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)