Skip to content

Commit

Permalink
Improved comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Bronek committed Oct 30, 2023
1 parent e386093 commit c477eb4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/ripple/protocol/STTx.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ class STTx final : public STObject, public CountedObject<STTx>
Json::Value
getJson(JsonOptions options) const override;

/// If `hash` is set, will store hash inside the provided string. Otherwise
/// hash will be stored as nested jss::hash element inside the returned JSON
/// Additionally, if `hash` is set and `binary` is true, will not create
/// nested jss::tx for binary hex; instead will return it as JSON string
/**
If `hash` is set, will store transaction id inside the provided string.
Otherwise it will be stored as nested jss::hash element inside the returned
JSON. Additionally, if `hash` is set and `binary` is true, will not create
nested jss::tx for binary hex; instead will return it as JSON string
*/
Json::Value
getJson(
JsonOptions options,
Expand Down
5 changes: 4 additions & 1 deletion src/ripple/protocol/impl/STTx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,10 @@ STTx::getJson(
Json::Value ret = strHex(s.peekData());
return ret;
}
return STObject::getJson(JsonOptions::none); // Yes, want `none`
// We want virtualy the same output as `getJson(JsonOptions)` overload
// above, but without the hash element. Since `getJson(JsonOptions)`
// is using STObject::getJson(JsonOptions::none), we use it here as well
return STObject::getJson(JsonOptions::none);
}

std::string const&
Expand Down

0 comments on commit c477eb4

Please sign in to comment.