ledger rpc accepts more flags. binary options for all rpcs. tests to verify ledger and account_info

This commit is contained in:
CJ Cobb
2021-03-09 16:33:24 -05:00
parent e3a121e571
commit f781bd6c00
11 changed files with 335 additions and 76 deletions

View File

@@ -58,9 +58,20 @@ doTx(boost::json::object const& request, BackendInterface const& backend)
return response;
}
auto [sttx, meta] = deserializeTxPlusMeta(dbResponse.value());
response["transaction"] = getJson(*sttx);
response["meta"] = getJson(*meta);
bool binary =
request.contains("binary") ? request.at("binary").as_bool() : false;
if (!binary)
{
auto [sttx, meta] = deserializeTxPlusMeta(dbResponse.value());
response["transaction"] = getJson(*sttx);
response["metadata"] = getJson(*meta);
}
else
{
response["transaction"] = ripple::strHex(dbResponse->transaction);
response["metadata"] = ripple::strHex(dbResponse->metadata);
}
response["ledger_sequence"] = dbResponse->ledgerSequence;
return response;
}