Add JsonOptions enum class to contain options passed to getJSON methods

This commit is contained in:
Mo Morsi
2019-06-08 01:10:33 -04:00
committed by Manoj doshi
parent c2138c4e88
commit f8365f5009
77 changed files with 382 additions and 270 deletions

View File

@@ -72,7 +72,8 @@ insertDeliveredAmount(
if (transactionMeta.hasDeliveredAmount())
{
meta[jss::delivered_amount] =
transactionMeta.getDeliveredAmount().getJson(1);
transactionMeta.getDeliveredAmount()
.getJson(JsonOptions::include_date);
return;
}
@@ -92,7 +93,8 @@ insertDeliveredAmount(
getCloseTime() > NetClock::time_point{446000000s})
{
meta[jss::delivered_amount] =
serializedTx->getFieldAmount(sfAmount).getJson(1);
serializedTx->getFieldAmount(sfAmount)
.getJson(JsonOptions::include_date);
return;
}
}

View File

@@ -119,7 +119,7 @@ getAccountObjects(ReadView const& ledger, AccountID const& account,
auto const sleNode = ledger.read(keylet::child(*iter));
if (type == ltINVALID || sleNode->getType () == type)
{
jvObjects.append (sleNode->getJson (0));
jvObjects.append (sleNode->getJson (JsonOptions::none));
if (++i == limit)
{
@@ -397,7 +397,7 @@ parseAccountIds(Json::Value const& jvArray)
void
injectSLE(Json::Value& jv, SLE const& sle)
{
jv = sle.getJson(0);
jv = sle.getJson(JsonOptions::none);
if (sle.getType() == ltACCOUNT_ROOT)
{
if (sle.isFieldPresent(sfEmailHash))

View File

@@ -227,10 +227,10 @@ static Json::Value checkPayment(
auto j = app.journal ("RPCHandler");
JLOG (j.debug())
<< "transactionSign: build_path: "
<< result.getJson (0);
<< result.getJson (JsonOptions::none);
if (! result.empty ())
tx_json[jss::Paths] = result.getJson (0);
tx_json[jss::Paths] = result.getJson (JsonOptions::none);
}
}
return Json::Value();
@@ -629,7 +629,7 @@ static Json::Value transactionFormatResultImpl (Transaction::pointer tpTrans)
Json::Value jvResult;
try
{
jvResult[jss::tx_json] = tpTrans->getJson (0);
jvResult[jss::tx_json] = tpTrans->getJson (JsonOptions::none);
jvResult[jss::tx_blob] = strHex (
tpTrans->getSTransaction ()->getSerializer ().peekData ());