mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
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
This commit is contained in:
parent
3df0411ad9
commit
9a8897f4ac
37 changed files with 213 additions and 2203 deletions
|
|
@ -23,10 +23,10 @@
|
|||
#include <boost/iostreams/concepts.hpp>
|
||||
#include <boost/iostreams/stream.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include "json_spirit_wrapper.h"
|
||||
|
||||
#include "univalue/univalue.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace json_spirit;
|
||||
|
||||
//! Number of bytes to allocate and read at most at once in post data
|
||||
const size_t POST_READ_SIZE = 256 * 1024;
|
||||
|
|
@ -254,7 +254,7 @@ int ReadHTTPMessage(std::basic_istream<char>& stream, map<string,
|
|||
* http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx
|
||||
*/
|
||||
|
||||
string JSONRPCRequest(const string& strMethod, const Array& params, const Value& id)
|
||||
string JSONRPCRequest(const string& strMethod, const UniValue& params, const UniValue& id)
|
||||
{
|
||||
UniValue request(UniValue::VOBJ);
|
||||
request.push_back(Pair("method", strMethod));
|
||||
|
|
@ -263,7 +263,7 @@ string JSONRPCRequest(const string& strMethod, const Array& params, const Value&
|
|||
return request.write() + "\n";
|
||||
}
|
||||
|
||||
Object JSONRPCReplyObj(const Value& result, const Value& error, const Value& id)
|
||||
UniValue JSONRPCReplyObj(const UniValue& result, const UniValue& error, const UniValue& id)
|
||||
{
|
||||
UniValue reply(UniValue::VOBJ);
|
||||
if (!error.isNull())
|
||||
|
|
@ -275,7 +275,7 @@ Object JSONRPCReplyObj(const Value& result, const Value& error, const Value& id)
|
|||
return reply;
|
||||
}
|
||||
|
||||
string JSONRPCReply(const Value& result, const Value& error, const Value& id)
|
||||
string JSONRPCReply(const UniValue& result, const UniValue& error, const UniValue& id)
|
||||
{
|
||||
UniValue reply = JSONRPCReplyObj(result, error, id);
|
||||
return reply.write() + "\n";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue