Skip to content

Commit

Permalink
Move this change to API version 2
Browse files Browse the repository at this point in the history
May want to revert this commit, if we decide to keep it at API version 3
  • Loading branch information
Bronek committed Nov 21, 2023
1 parent db803bc commit 62d51a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ripple/app/ledger/impl/LedgerToJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fillJson(
unsigned apiVersion)
{
json[jss::parent_hash] = to_string(info.parentHash);
json[jss::ledger_index] = (apiVersion > 2)
json[jss::ledger_index] = (apiVersion > 1)
? Json::Value(info.seq)
: Json::Value(std::to_string(info.seq));

Expand Down Expand Up @@ -168,7 +168,7 @@ fillJsonTx(
if (validated)
{
auto const seq = fill.ledger.seq();
txJson[jss::ledger_index] = (fill.context->apiVersion > 2)
txJson[jss::ledger_index] = (fill.context->apiVersion > 1)
? Json::Value(seq)
: Json::Value(std::to_string(seq));
if (fill.closeTime)
Expand Down
2 changes: 1 addition & 1 deletion src/ripple/app/misc/NetworkOPs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,7 @@ NetworkOPsImp::pubValidation(std::shared_ptr<STValidation> const& val)
multiObj, //
[](Json::Value& jvTx, unsigned int apiVersion) {
// Type conversion for older API versions to string
if (jvTx.isMember(jss::ledger_index) && apiVersion < 3)
if (jvTx.isMember(jss::ledger_index) && apiVersion < 2)
{
jvTx[jss::ledger_index] =
std::to_string(jvTx[jss::ledger_index].asUInt());
Expand Down

0 comments on commit 62d51a0

Please sign in to comment.