mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01: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:
@@ -20,9 +20,9 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <boost/assign/list_of.hpp>
|
||||
#include "json_spirit_wrapper.h"
|
||||
|
||||
using namespace json_spirit;
|
||||
#include "univalue/univalue.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
@@ -38,7 +38,7 @@ using namespace std;
|
||||
*
|
||||
* Or alternatively, create a specific query method for the information.
|
||||
**/
|
||||
UniValue getinfo(const Array& params, bool fHelp)
|
||||
UniValue getinfo(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 0)
|
||||
throw runtime_error(
|
||||
@@ -107,7 +107,7 @@ UniValue getinfo(const Array& params, bool fHelp)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
class DescribeAddressVisitor : public boost::static_visitor<Object>
|
||||
class DescribeAddressVisitor : public boost::static_visitor<UniValue>
|
||||
{
|
||||
private:
|
||||
isminetype mine;
|
||||
@@ -115,7 +115,7 @@ private:
|
||||
public:
|
||||
DescribeAddressVisitor(isminetype mineIn) : mine(mineIn) {}
|
||||
|
||||
UniValue operator()(const CNoDestination &dest) const { return Object(); }
|
||||
UniValue operator()(const CNoDestination &dest) const { return UniValue(UniValue::VOBJ); }
|
||||
|
||||
UniValue operator()(const CKeyID &keyID) const {
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
};
|
||||
#endif
|
||||
|
||||
UniValue validateaddress(const Array& params, bool fHelp)
|
||||
UniValue validateaddress(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 1)
|
||||
throw runtime_error(
|
||||
@@ -215,10 +215,10 @@ UniValue validateaddress(const Array& params, bool fHelp)
|
||||
/**
|
||||
* Used by addmultisigaddress / createmultisig:
|
||||
*/
|
||||
CScript _createmultisig_redeemScript(const Array& params)
|
||||
CScript _createmultisig_redeemScript(const UniValue& params)
|
||||
{
|
||||
int nRequired = params[0].get_int();
|
||||
const Array& keys = params[1].get_array();
|
||||
const UniValue& keys = params[1].get_array();
|
||||
|
||||
// Gather public keys
|
||||
if (nRequired < 1)
|
||||
@@ -276,7 +276,7 @@ CScript _createmultisig_redeemScript(const Array& params)
|
||||
return result;
|
||||
}
|
||||
|
||||
UniValue createmultisig(const Array& params, bool fHelp)
|
||||
UniValue createmultisig(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() < 2 || params.size() > 2)
|
||||
{
|
||||
@@ -319,7 +319,7 @@ UniValue createmultisig(const Array& params, bool fHelp)
|
||||
return result;
|
||||
}
|
||||
|
||||
UniValue verifymessage(const Array& params, bool fHelp)
|
||||
UniValue verifymessage(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 3)
|
||||
throw runtime_error(
|
||||
@@ -373,7 +373,7 @@ UniValue verifymessage(const Array& params, bool fHelp)
|
||||
return (pubkey.GetID() == keyID);
|
||||
}
|
||||
|
||||
UniValue setmocktime(const Array& params, bool fHelp)
|
||||
UniValue setmocktime(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 1)
|
||||
throw runtime_error(
|
||||
|
||||
Reference in New Issue
Block a user