remove JSON Spirit UniValue wrapper

This commit is contained in:
Jonas Schnelli
2015-05-13 21:29:19 +02:00
committed by Jack Grigg
parent 565d26737a
commit 851f58f94e
23 changed files with 255 additions and 274 deletions

View File

@@ -74,7 +74,7 @@ double GetNetworkDifficulty(const CBlockIndex* blockindex)
}
Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false)
UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false)
{
UniValue result(UniValue::VOBJ);
result.push_back(Pair("hash", block.GetHash().GetHex()));
@@ -116,7 +116,7 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDe
}
Value getblockcount(const Array& params, bool fHelp)
UniValue getblockcount(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
@@ -133,7 +133,7 @@ Value getblockcount(const Array& params, bool fHelp)
return chainActive.Height();
}
Value getbestblockhash(const Array& params, bool fHelp)
UniValue getbestblockhash(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
@@ -150,7 +150,7 @@ Value getbestblockhash(const Array& params, bool fHelp)
return chainActive.Tip()->GetBlockHash().GetHex();
}
Value getdifficulty(const Array& params, bool fHelp)
UniValue getdifficulty(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
@@ -168,7 +168,7 @@ Value getdifficulty(const Array& params, bool fHelp)
}
Value getrawmempool(const Array& params, bool fHelp)
UniValue getrawmempool(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
@@ -253,7 +253,7 @@ Value getrawmempool(const Array& params, bool fHelp)
}
}
Value getblockhash(const Array& params, bool fHelp)
UniValue getblockhash(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
@@ -278,7 +278,7 @@ Value getblockhash(const Array& params, bool fHelp)
return pblockindex->GetBlockHash().GetHex();
}
Value getblock(const Array& params, bool fHelp)
UniValue getblock(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
@@ -346,7 +346,7 @@ Value getblock(const Array& params, bool fHelp)
return blockToJSON(block, pblockindex);
}
Value gettxoutsetinfo(const Array& params, bool fHelp)
UniValue gettxoutsetinfo(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
@@ -386,7 +386,7 @@ Value gettxoutsetinfo(const Array& params, bool fHelp)
return ret;
}
Value gettxout(const Array& params, bool fHelp)
UniValue gettxout(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 3)
throw runtime_error(
@@ -466,7 +466,7 @@ Value gettxout(const Array& params, bool fHelp)
return ret;
}
Value verifychain(const Array& params, bool fHelp)
UniValue verifychain(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
@@ -524,7 +524,7 @@ Object SoftForkDesc(const std::string &name, int version, CBlockIndex* pindex, c
return rv;
}
Value getblockchaininfo(const Array& params, bool fHelp)
UniValue getblockchaininfo(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
@@ -609,7 +609,7 @@ struct CompareBlocksByHeight
}
};
Value getchaintips(const Array& params, bool fHelp)
UniValue getchaintips(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
@@ -699,7 +699,7 @@ Value getchaintips(const Array& params, bool fHelp)
return res;
}
Value getmempoolinfo(const Array& params, bool fHelp)
UniValue getmempoolinfo(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
@@ -722,7 +722,7 @@ Value getmempoolinfo(const Array& params, bool fHelp)
return ret;
}
Value invalidateblock(const Array& params, bool fHelp)
UniValue invalidateblock(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
@@ -760,7 +760,7 @@ Value invalidateblock(const Array& params, bool fHelp)
return NullUniValue;
}
Value reconsiderblock(const Array& params, bool fHelp)
UniValue reconsiderblock(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(