chore: Set ColumnLimit to 120 in clang-format (#6288)

This change updates the ColumnLimit from 80 to 120, and applies clang-format to reformat the code.
This commit is contained in:
Ayaz Salikhov
2026-01-28 18:09:50 +00:00
committed by GitHub
parent 92046785d1
commit 5f638f5553
1016 changed files with 26918 additions and 66660 deletions

View File

@@ -23,8 +23,7 @@ class TransactionEntry_test : public beast::unit_test::suite
{
// no params
auto const result =
env.client().invoke("transaction_entry", {})[jss::result];
auto const result = env.client().invoke("transaction_entry", {})[jss::result];
BEAST_EXPECT(result[jss::error] == "fieldNotFoundTransaction");
BEAST_EXPECT(result[jss::status] == "error");
}
@@ -32,8 +31,7 @@ class TransactionEntry_test : public beast::unit_test::suite
{
Json::Value params{Json::objectValue};
params[jss::ledger] = 20;
auto const result =
env.client().invoke("transaction_entry", params)[jss::result];
auto const result = env.client().invoke("transaction_entry", params)[jss::result];
BEAST_EXPECT(result[jss::error] == "lgrNotFound");
BEAST_EXPECT(result[jss::status] == "error");
}
@@ -42,8 +40,7 @@ class TransactionEntry_test : public beast::unit_test::suite
Json::Value params{Json::objectValue};
params[jss::ledger] = "current";
params[jss::tx_hash] = "DEADBEEF";
auto const result =
env.client().invoke("transaction_entry", params)[jss::result];
auto const result = env.client().invoke("transaction_entry", params)[jss::result];
BEAST_EXPECT(result[jss::error] == "notYetImplemented");
BEAST_EXPECT(result[jss::status] == "error");
}
@@ -52,15 +49,13 @@ class TransactionEntry_test : public beast::unit_test::suite
Json::Value params{Json::objectValue};
params[jss::ledger] = "closed";
params[jss::tx_hash] = "DEADBEEF";
auto const result =
env.client().invoke("transaction_entry", params)[jss::result];
auto const result = env.client().invoke("transaction_entry", params)[jss::result];
BEAST_EXPECT(!result[jss::ledger_hash].asString().empty());
BEAST_EXPECT(result[jss::error] == "malformedRequest");
BEAST_EXPECT(result[jss::status] == "error");
}
std::string const txHash{
"E2FE8D4AF3FCC3944DDF6CD8CDDC5E3F0AD50863EF8919AFEF10CB6408CD4D05"};
std::string const txHash{"E2FE8D4AF3FCC3944DDF6CD8CDDC5E3F0AD50863EF8919AFEF10CB6408CD4D05"};
// Command line format
{
@@ -80,24 +75,21 @@ class TransactionEntry_test : public beast::unit_test::suite
{
// First argument with too few characters
Json::Value const result{
env.rpc("transaction_entry", txHash.substr(1), "closed")};
Json::Value const result{env.rpc("transaction_entry", txHash.substr(1), "closed")};
BEAST_EXPECT(result[jss::error] == "invalidParams");
BEAST_EXPECT(result[jss::status] == "error");
}
{
// First argument with too many characters
Json::Value const result{
env.rpc("transaction_entry", txHash + "A", "closed")};
Json::Value const result{env.rpc("transaction_entry", txHash + "A", "closed")};
BEAST_EXPECT(result[jss::error] == "invalidParams");
BEAST_EXPECT(result[jss::status] == "error");
}
{
// Second argument not valid
Json::Value const result{
env.rpc("transaction_entry", txHash, "closer")};
Json::Value const result{env.rpc("transaction_entry", txHash, "closer")};
BEAST_EXPECT(result[jss::error] == "invalidParams");
BEAST_EXPECT(result[jss::status] == "error");
}
@@ -111,20 +103,16 @@ class TransactionEntry_test : public beast::unit_test::suite
{
// Three arguments
Json::Value const result{
env.rpc("transaction_entry", txHash, "closed", "extra")};
Json::Value const result{env.rpc("transaction_entry", txHash, "closed", "extra")};
BEAST_EXPECT(result[jss::error] == "badSyntax");
BEAST_EXPECT(result[jss::status] == "error");
}
{
// Valid structure, but transaction not found.
Json::Value const result{
env.rpc("transaction_entry", txHash, "closed")};
BEAST_EXPECT(
!result[jss::result][jss::ledger_hash].asString().empty());
BEAST_EXPECT(
result[jss::result][jss::error] == "transactionNotFound");
Json::Value const result{env.rpc("transaction_entry", txHash, "closed")};
BEAST_EXPECT(!result[jss::result][jss::ledger_hash].asString().empty());
BEAST_EXPECT(result[jss::result][jss::error] == "transactionNotFound");
BEAST_EXPECT(result[jss::result][jss::status] == "error");
}
}
@@ -151,8 +139,7 @@ class TransactionEntry_test : public beast::unit_test::suite
params[jss::ledger_index] = index;
params[jss::tx_hash] = txhash;
params[jss::api_version] = apiVersion;
return env.client().invoke(
"transaction_entry", params)[jss::result];
return env.client().invoke("transaction_entry", params)[jss::result];
}()};
if (!BEAST_EXPECT(resIndex.isMember(jss::tx_json)))
@@ -168,8 +155,7 @@ class TransactionEntry_test : public beast::unit_test::suite
BEAST_EXPECT(!resIndex[jss::tx_json].isMember(jss::Amount));
if (BEAST_EXPECT(!close_time_iso.empty()))
BEAST_EXPECT(
resIndex[jss::close_time_iso] == close_time_iso);
BEAST_EXPECT(resIndex[jss::close_time_iso] == close_time_iso);
}
else
{
@@ -183,12 +169,9 @@ class TransactionEntry_test : public beast::unit_test::suite
Json::Value expected;
Json::Reader().parse(expected_json, expected);
if (RPC::contains_error(expected))
Throw<std::runtime_error>(
"Internal JSONRPC_test error. Bad test JSON.");
Throw<std::runtime_error>("Internal JSONRPC_test error. Bad test JSON.");
for (auto memberIt = expected.begin();
memberIt != expected.end();
memberIt++)
for (auto memberIt = expected.begin(); memberIt != expected.end(); memberIt++)
{
auto const name = memberIt.memberName();
if (BEAST_EXPECT(resIndex[jss::tx_json].isMember(name)))
@@ -211,25 +194,17 @@ class TransactionEntry_test : public beast::unit_test::suite
params[jss::ledger_hash] = resIndex[jss::ledger_hash];
params[jss::tx_hash] = txhash;
params[jss::api_version] = apiVersion;
Json::Value const resHash = env.client().invoke(
"transaction_entry", params)[jss::result];
Json::Value const resHash = env.client().invoke("transaction_entry", params)[jss::result];
BEAST_EXPECT(resHash == resIndex);
}
// Use the command line form with the index.
Json::Value const clIndex{env.rpc(
apiVersion,
"transaction_entry",
txhash,
std::to_string(index))};
Json::Value const clIndex{env.rpc(apiVersion, "transaction_entry", txhash, std::to_string(index))};
BEAST_EXPECT(clIndex["result"] == resIndex);
// Use the command line form with the ledger_hash.
Json::Value const clHash{env.rpc(
apiVersion,
"transaction_entry",
txhash,
resIndex[jss::ledger_hash].asString())};
Json::Value const clHash{
env.rpc(apiVersion, "transaction_entry", txhash, resIndex[jss::ledger_hash].asString())};
BEAST_EXPECT(clHash["result"] == resIndex);
};
@@ -238,15 +213,11 @@ class TransactionEntry_test : public beast::unit_test::suite
env.fund(XRP(10000), A1);
auto fund_1_tx = to_string(env.tx()->getTransactionID());
BEAST_EXPECT(
fund_1_tx ==
"F4E9DF90D829A9E8B423FF68C34413E240D8D8BB0EFD080DF08114ED398E2506");
BEAST_EXPECT(fund_1_tx == "F4E9DF90D829A9E8B423FF68C34413E240D8D8BB0EFD080DF08114ED398E2506");
env.fund(XRP(10000), A2);
auto fund_2_tx = to_string(env.tx()->getTransactionID());
BEAST_EXPECT(
fund_2_tx ==
"6853CD8226A05068C951CB1F54889FF4E40C5B440DC1C5BA38F114C4E0B1E705");
BEAST_EXPECT(fund_2_tx == "6853CD8226A05068C951CB1F54889FF4E40C5B440DC1C5BA38F114C4E0B1E705");
env.close();
@@ -286,16 +257,12 @@ class TransactionEntry_test : public beast::unit_test::suite
// refunds fees with a payment after TrustSet..so just ignore the type
// in the check below
auto trust_tx = to_string(env.tx()->getTransactionID());
BEAST_EXPECT(
trust_tx ==
"C992D97D88FF444A1AB0C06B27557EC54B7F7DA28254778E60238BEA88E0C101");
BEAST_EXPECT(trust_tx == "C992D97D88FF444A1AB0C06B27557EC54B7F7DA28254778E60238BEA88E0C101");
env(pay(A2, A1, A2["USD"](5)));
auto pay_tx = to_string(env.tx()->getTransactionID());
env.close();
BEAST_EXPECT(
pay_tx ==
"988046D484ACE9F5F6A8C792D89C6EA2DB307B5DDA9864AEBA88E6782ABD0865");
BEAST_EXPECT(pay_tx == "988046D484ACE9F5F6A8C792D89C6EA2DB307B5DDA9864AEBA88E6782ABD0865");
check_tx(
env.closed()->seq(),
@@ -338,9 +305,7 @@ class TransactionEntry_test : public beast::unit_test::suite
env(offer(A2, XRP(100), A2["USD"](1)));
auto offer_tx = to_string(env.tx()->getTransactionID());
BEAST_EXPECT(
offer_tx ==
"5FCC1A27A7664F82A0CC4BE5766FBBB7C560D52B93AA7B550CD33B27AEC7EFFB");
BEAST_EXPECT(offer_tx == "5FCC1A27A7664F82A0CC4BE5766FBBB7C560D52B93AA7B550CD33B27AEC7EFFB");
env.close();
check_tx(
@@ -370,8 +335,7 @@ public:
run() override
{
testBadInput();
forAllApiVersions(
std::bind_front(&TransactionEntry_test::testRequest, this));
forAllApiVersions(std::bind_front(&TransactionEntry_test::testRequest, this));
}
};