mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Use jss for many Json fields.
* Document JsonFields. * Remove some unused JsonFields values.
This commit is contained in:
@@ -166,7 +166,7 @@ Json::Value make_error (error_code_i code, std::string const& message)
|
||||
|
||||
bool contains_error (Json::Value const& json)
|
||||
{
|
||||
if (json.isObject() && json.isMember ("error"))
|
||||
if (json.isObject() && json.isMember (jss::error))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -876,7 +876,7 @@ amountFromJson (SField::ref name, Json::Value const& v)
|
||||
if (v.isObject ())
|
||||
{
|
||||
WriteLog (lsTRACE, STAmount) <<
|
||||
"value='" << v["value"].asString () <<
|
||||
"value='" << v[jss::value].asString () <<
|
||||
"', currency='" << v["currency"].asString () <<
|
||||
"', issuer='" << v["issuer"].asString () <<
|
||||
"')";
|
||||
|
||||
@@ -113,7 +113,7 @@ Json::Value STLedgerEntry::getJson (int options) const
|
||||
{
|
||||
Json::Value ret (STObject::getJson (options));
|
||||
|
||||
ret["index"] = to_string (mIndex);
|
||||
ret[jss::index] = to_string (mIndex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ void STTx::setSourceAccount (RippleAddress const& naSource)
|
||||
Json::Value STTx::getJson (int) const
|
||||
{
|
||||
Json::Value ret = STObject::getJson (0);
|
||||
ret["hash"] = to_string (getTransactionID ());
|
||||
ret[jss::hash] = to_string (getTransactionID ());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -231,8 +231,8 @@ Json::Value STTx::getJson (int options, bool binary) const
|
||||
{
|
||||
Json::Value ret;
|
||||
Serializer s = STObject::getSerializer ();
|
||||
ret["tx"] = strHex (s.peekData ());
|
||||
ret["hash"] = to_string (getTransactionID ());
|
||||
ret[jss::tx] = strHex (s.peekData ());
|
||||
ret[jss::hash] = to_string (getTransactionID ());
|
||||
return ret;
|
||||
}
|
||||
return getJson(options);
|
||||
|
||||
Reference in New Issue
Block a user