Skip to content

Commit d4d0f62

Browse files
committed
add comments to explain the changed interface for unit test utility functions
1 parent 7f2fdb9 commit d4d0f62

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/ripple/rpc/handlers/Submit.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ getFailHard(RPC::JsonContext const& context)
4242

4343
// This is helper function that is used to calculate the CheckID field in a
4444
// CheckCreate transaction.
45-
// The function returns false, if an error occurs in the parsing of the input
45+
// The function returns false, if an error occurs whilst parsing the input
4646
// transaction.
4747
// Otherwise, true is returned and appropriate CheckID is populated in the
4848
// response
@@ -65,7 +65,7 @@ populateCheckID(
6565
return false;
6666
}
6767

68-
if(result[jss::engine_result] == "tesSUCCESS")
68+
if (result[jss::engine_result] == "tesSUCCESS")
6969
result[jss::CheckID] = to_string(keylet::check(*acctID, seq).key);
7070

7171
return true;

src/test/app/Check_test.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ class Check_test : public beast::unit_test::suite
257257
// CheckID must be returned upon successful creation of a Check object
258258
BEAST_EXPECT(jr.has_value());
259259
BEAST_EXPECT((*jr)["result"].isMember(jss::CheckID));
260-
BEAST_EXPECT((*jr)["result"][jss::CheckID] == "DE86D4F9A732A12247B774C34175B3DD0E51D4D7407A34F67ADA2C398359289F");
260+
BEAST_EXPECT(
261+
(*jr)["result"][jss::CheckID] ==
262+
"DE86D4F9A732A12247B774C34175B3DD0E51D4D7407A34F67ADA2C398359289F");
261263

262264
env(check::create(alice, bob, USD(50)), source_tag(2));
263265
env.close();

src/test/jtx/Env.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ class Env
498498

499499
/** Submit an existing JTx.
500500
This calls postconditions.
501+
502+
If the input is parsed successfully, then the RPC response is returned.
503+
Otherwise, the return value optional is not set
501504
*/
502505
virtual std::optional<Json::Value>
503506
submit(JTx const& jt);
@@ -514,7 +517,8 @@ class Env
514517
void
515518
postconditions(JTx const& jt, TER ter, bool didApply);
516519

517-
/** Apply funclets and submit. */
520+
/** Apply funclets and submit. If the RPC command is sucessful, the
521+
* response is returned.*/
518522
/** @{ */
519523
template <class JsonValue, class... FN>
520524
std::optional<Json::Value>

0 commit comments

Comments
 (0)