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

@@ -62,10 +62,7 @@ STPathElement
IPE(Issue const& iss)
{
return STPathElement(
STPathElement::typeCurrency | STPathElement::typeIssuer,
xrpAccount(),
iss.currency,
iss.account);
STPathElement::typeCurrency | STPathElement::typeIssuer, xrpAccount(), iss.currency, iss.account);
}
/******************************************************************************/
@@ -84,11 +81,7 @@ xrpMinusFee(Env const& env, std::int64_t xrpAmount)
};
[[nodiscard]] bool
expectHolding(
Env& env,
AccountID const& account,
STAmount const& value,
bool defaultLimits)
expectHolding(Env& env, AccountID const& account, STAmount const& value, bool defaultLimits)
{
if (auto const sle = env.le(keylet::line(account, value.issue())))
{
@@ -104,8 +97,7 @@ expectHolding(
low.setIssuer(accountLow ? account : issue.account);
high.setIssuer(accountLow ? issue.account : account);
expectDefaultTrustLine = sle->getFieldAmount(sfLowLimit) == low &&
sle->getFieldAmount(sfHighLimit) == high;
expectDefaultTrustLine = sle->getFieldAmount(sfLowLimit) == low && sle->getFieldAmount(sfHighLimit) == high;
}
auto amount = sle->getFieldAmount(sfBalance);
@@ -118,21 +110,13 @@ expectHolding(
}
[[nodiscard]] bool
expectHolding(
Env& env,
AccountID const& account,
None const&,
Issue const& issue)
expectHolding(Env& env, AccountID const& account, None const&, Issue const& issue)
{
return !env.le(keylet::line(account, issue));
}
[[nodiscard]] bool
expectHolding(
Env& env,
AccountID const& account,
None const&,
MPTIssue const& mptIssue)
expectHolding(Env& env, AccountID const& account, None const&, MPTIssue const& mptIssue)
{
return !env.le(keylet::mptoken(mptIssue.getMptID(), account));
}
@@ -141,37 +125,27 @@ expectHolding(
expectHolding(Env& env, AccountID const& account, None const& value)
{
return std::visit(
[&](auto const& issue) {
return expectHolding(env, account, value, issue);
},
value.asset.value());
[&](auto const& issue) { return expectHolding(env, account, value, issue); }, value.asset.value());
}
[[nodiscard]] bool
expectOffers(
Env& env,
AccountID const& account,
std::uint16_t size,
std::vector<Amounts> const& toMatch)
expectOffers(Env& env, AccountID const& account, std::uint16_t size, std::vector<Amounts> const& toMatch)
{
std::uint16_t cnt = 0;
std::uint16_t matched = 0;
forEachItem(
*env.current(), account, [&](std::shared_ptr<SLE const> const& sle) {
if (!sle)
return false;
if (sle->getType() == ltOFFER)
{
++cnt;
if (std::find_if(
toMatch.begin(), toMatch.end(), [&](auto const& a) {
return a.in == sle->getFieldAmount(sfTakerPays) &&
a.out == sle->getFieldAmount(sfTakerGets);
}) != toMatch.end())
++matched;
}
return true;
});
forEachItem(*env.current(), account, [&](std::shared_ptr<SLE const> const& sle) {
if (!sle)
return false;
if (sle->getType() == ltOFFER)
{
++cnt;
if (std::find_if(toMatch.begin(), toMatch.end(), [&](auto const& a) {
return a.in == sle->getFieldAmount(sfTakerPays) && a.out == sle->getFieldAmount(sfTakerGets);
}) != toMatch.end())
++matched;
}
return true;
});
return size == cnt && matched == toMatch.size();
}
@@ -185,11 +159,7 @@ ledgerEntryRoot(Env& env, Account const& acct)
}
Json::Value
ledgerEntryState(
Env& env,
Account const& acct_a,
Account const& acct_b,
std::string const& currency)
ledgerEntryState(Env& env, Account const& acct_a, Account const& acct_b, std::string const& currency)
{
Json::Value jvParams;
jvParams[jss::ledger_index] = "current";
@@ -208,10 +178,7 @@ accountBalance(Env& env, Account const& acct)
}
[[nodiscard]] bool
expectLedgerEntryRoot(
Env& env,
Account const& acct,
STAmount const& expectedValue)
expectLedgerEntryRoot(Env& env, Account const& acct, STAmount const& expectedValue)
{
return accountBalance(env, acct) == to_string(expectedValue.xrp());
}
@@ -286,10 +253,7 @@ claim(
}
uint256
channel(
AccountID const& account,
AccountID const& dst,
std::uint32_t seqProxyValue)
channel(AccountID const& account, AccountID const& dst, std::uint32_t seqProxyValue)
{
auto const k = keylet::payChan(account, dst, seqProxyValue);
return k.key;
@@ -317,12 +281,7 @@ channelExists(ReadView const& view, uint256 const& chan)
/******************************************************************************/
void
n_offers(
Env& env,
std::size_t n,
Account const& account,
STAmount const& in,
STAmount const& out)
n_offers(Env& env, std::size_t n, Account const& account, STAmount const& in, STAmount const& out)
{
auto const ownerCount = env.le(account)->getFieldU32(sfOwnerCount);
for (std::size_t i = 0; i < n; i++)
@@ -340,8 +299,7 @@ n_offers(
STPathElement
cpe(Currency const& c)
{
return STPathElement(
STPathElement::typeCurrency, xrpAccount(), c, xrpAccount());
return STPathElement(STPathElement::typeCurrency, xrpAccount(), c, xrpAccount());
};
// All path element
@@ -349,8 +307,7 @@ STPathElement
allpe(AccountID const& a, Issue const& iss)
{
return STPathElement(
STPathElement::typeAccount | STPathElement::typeCurrency |
STPathElement::typeIssuer,
STPathElement::typeAccount | STPathElement::typeCurrency | STPathElement::typeIssuer,
a,
iss.currency,
iss.account);
@@ -384,11 +341,7 @@ del(AccountID const& account, uint256 const& brokerID, uint32_t flags)
}
Json::Value
coverDeposit(
AccountID const& account,
uint256 const& brokerID,
STAmount const& amount,
uint32_t flags)
coverDeposit(AccountID const& account, uint256 const& brokerID, STAmount const& amount, uint32_t flags)
{
Json::Value jv;
jv[sfTransactionType] = jss::LoanBrokerCoverDeposit;
@@ -400,11 +353,7 @@ coverDeposit(
}
Json::Value
coverWithdraw(
AccountID const& account,
uint256 const& brokerID,
STAmount const& amount,
uint32_t flags)
coverWithdraw(AccountID const& account, uint256 const& brokerID, STAmount const& amount, uint32_t flags)
{
Json::Value jv;
jv[sfTransactionType] = jss::LoanBrokerCoverWithdraw;
@@ -432,10 +381,7 @@ coverClawback(AccountID const& account, std::uint32_t flags)
namespace loan {
Json::Value
set(AccountID const& account,
uint256 const& loanBrokerID,
Number principalRequested,
std::uint32_t flags)
set(AccountID const& account, uint256 const& loanBrokerID, Number principalRequested, std::uint32_t flags)
{
Json::Value jv;
jv[sfTransactionType] = jss::LoanSet;
@@ -469,10 +415,7 @@ del(AccountID const& account, uint256 const& loanID, std::uint32_t flags)
}
Json::Value
pay(AccountID const& account,
uint256 const& loanID,
STAmount const& amount,
std::uint32_t flags)
pay(AccountID const& account, uint256 const& loanID, STAmount const& amount, std::uint32_t flags)
{
Json::Value jv;
jv[sfTransactionType] = jss::LoanPay;