From c7ecfc6a970b2ef527097e51545cebc4285ed684 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 15 May 2026 19:02:04 -0400 Subject: [PATCH] refactor: Clean up comments post-clang-tidy changes (#7283) --- .../xrpl/protocol/detail/ledger_entries.macro | 4 ++-- .../ledger/helpers/RippleStateHelpers.cpp | 16 ++++++++-------- src/libxrpl/ledger/helpers/TokenHelpers.cpp | 2 +- src/libxrpl/tx/Transactor.cpp | 2 +- .../tx/transactors/delegate/DelegateSet.cpp | 4 ++-- src/libxrpl/tx/transactors/dex/AMMVote.cpp | 10 +++++----- src/libxrpl/tx/transactors/lending/LoanPay.cpp | 2 +- src/test/app/AMMMPT_test.cpp | 2 +- src/test/app/Invariants_test.cpp | 2 +- src/xrpld/app/misc/NetworkOPs.cpp | 2 +- src/xrpld/app/misc/detail/TxQ.cpp | 2 +- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/xrpl/protocol/detail/ledger_entries.macro b/include/xrpl/protocol/detail/ledger_entries.macro index bf641862d1..c4b392a92f 100644 --- a/include/xrpl/protocol/detail/ledger_entries.macro +++ b/include/xrpl/protocol/detail/ledger_entries.macro @@ -84,7 +84,7 @@ LEDGER_ENTRY(ltNEGATIVE_UNL, 0x004e, NegativeUNL, nunl, ({ /** A ledger object which contains a list of NFTs - \sa keylet::nftpage_min, keylet::nftpage_max, keylet::nftpage + \sa keylet::nftpageMin, keylet::nftpageMax, keylet::nftpage */ LEDGER_ENTRY(ltNFTOKEN_PAGE, 0x0050, NFTokenPage, nft_page, ({ {sfPreviousPageMin, SoeOptional}, @@ -112,7 +112,7 @@ LEDGER_ENTRY(ltSIGNER_LIST, 0x0053, SignerList, signer_list, ({ /** A ledger object which describes a ticket. - \sa keylet::ticket + \sa keylet::kTicket */ LEDGER_ENTRY(ltTICKET, 0x0054, Ticket, ticket, ({ {sfAccount, SoeRequired}, diff --git a/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp b/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp index 3b37dff23c..5aaa417ad9 100644 --- a/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp +++ b/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp @@ -183,15 +183,15 @@ trustCreate( bool const bSrcHigh, AccountID const& uSrcAccountID, AccountID const& uDstAccountID, - uint256 const& uIndex, // --> ripple state entry - SLE::ref sleAccount, // --> the account being set. - bool const bAuth, // --> authorize account. - bool const bNoRipple, // --> others cannot ripple through - bool const bFreeze, // --> funds cannot leave - bool bDeepFreeze, // --> can neither receive nor send funds - STAmount const& saBalance, // --> balance of account being set. + uint256 const& uIndex, // ripple state entry + SLE::ref sleAccount, // the account being set. + bool const bAuth, // authorize account. + bool const bNoRipple, // others cannot ripple through + bool const bFreeze, // funds cannot leave + bool bDeepFreeze, // can neither receive nor send funds + STAmount const& saBalance, // balance of account being set. // Issuer should be noAccount() - STAmount const& saLimit, // --> limit for account being set. + STAmount const& saLimit, // limit for account being set. // Issuer should be the account being set. std::uint32_t uQualityIn, std::uint32_t uQualityOut, diff --git a/src/libxrpl/ledger/helpers/TokenHelpers.cpp b/src/libxrpl/ledger/helpers/TokenHelpers.cpp index 0c20392f4f..c9dccb884d 100644 --- a/src/libxrpl/ledger/helpers/TokenHelpers.cpp +++ b/src/libxrpl/ledger/helpers/TokenHelpers.cpp @@ -1191,7 +1191,7 @@ directSendNoLimitMultiMPT( // Use uint64_t, not STAmount, to keep MaximumAmount comparisons in exact // integer arithmetic. STAmount implicitly converts to Number, whose // small-scale mantissa (~16 digits) can lose precision for values near - // maxMPTokenAmount (19 digits). + // kMaxMpTokenAmount (19 digits). std::uint64_t totalSendAmount{0}; std::uint64_t const maximumAmount = sle->at(~sfMaximumAmount).value_or(kMaxMpTokenAmount); std::uint64_t const outstandingAmount = sle->getFieldU64(sfOutstandingAmount); diff --git a/src/libxrpl/tx/Transactor.cpp b/src/libxrpl/tx/Transactor.cpp index 81a30fc5ef..995013a3ca 100644 --- a/src/libxrpl/tx/Transactor.cpp +++ b/src/libxrpl/tx/Transactor.cpp @@ -1238,7 +1238,7 @@ Transactor::operator()() if (isTecClaim(result) && ((view().flags() & TapFailHard) != 0u)) { - // If the tapFAIL_HARD flag is set, a tec result + // If the TapFailHard flag is set, a tec result // must not do anything ctx_.discard(); applied = false; diff --git a/src/libxrpl/tx/transactors/delegate/DelegateSet.cpp b/src/libxrpl/tx/transactors/delegate/DelegateSet.cpp index 085af8b4c7..990767c819 100644 --- a/src/libxrpl/tx/transactors/delegate/DelegateSet.cpp +++ b/src/libxrpl/tx/transactors/delegate/DelegateSet.cpp @@ -115,8 +115,8 @@ DelegateSet::doApply() (*sle)[sfOwnerNode] = *page; - // Add to authorized account's owner directory so the object can be found - // and cleaned up when the authorized account is deleted. + // Add to authorized account's owner directory so AccountDelete can find + // and clean up inbound delegations when the authorized account is deleted. auto const destPage = ctx_.view().dirInsert( keylet::ownerDir(authAccount), delegateKey, describeOwnerDir(authAccount)); diff --git a/src/libxrpl/tx/transactors/dex/AMMVote.cpp b/src/libxrpl/tx/transactors/dex/AMMVote.cpp index 30ae6004f0..a4afb5392e 100644 --- a/src/libxrpl/tx/transactors/dex/AMMVote.cpp +++ b/src/libxrpl/tx/transactors/dex/AMMVote.cpp @@ -80,14 +80,14 @@ AMMVote::preclaim(PreclaimContext const& ctx) } static std::pair -applyVote(ApplyContext& ctx, Sandbox& sb, AccountID const& account, beast::Journal j) +applyVote(ApplyContext& ctx, Sandbox& sb, AccountID const& accountID, beast::Journal j) { auto const feeNew = ctx.tx[sfTradingFee]; auto ammSle = sb.peek(keylet::amm(ctx.tx[sfAsset], ctx.tx[sfAsset2])); if (!ammSle) return {tecINTERNAL, false}; STAmount const lptAMMBalance = (*ammSle)[sfLPTokenBalance]; - auto const lpTokensNew = ammLPHolds(sb, *ammSle, account, ctx.journal); + auto const lpTokensNew = ammLPHolds(sb, *ammSle, accountID, ctx.journal); std::optional minTokens; std::size_t minPos{0}; AccountID minAccount{0}; @@ -108,13 +108,13 @@ applyVote(ApplyContext& ctx, Sandbox& sb, AccountID const& account, beast::Journ auto lpTokens = ammLPHolds(sb, *ammSle, entryAccount, ctx.journal); if (lpTokens == beast::kZero) { - JLOG(j.debug()) << "AMMVote::applyVote, account " << entryAccount << " is not LP"; + JLOG(j.debug()) << "AMMVote::applyVote, accountID " << entryAccount << " is not LP"; continue; } auto feeVal = entry[sfTradingFee]; STObject newEntry = STObject::makeInnerObject(sfVoteEntry); // The account already has the vote entry. - if (entryAccount == account) + if (entryAccount == accountID) { lpTokens = lpTokensNew; feeVal = feeNew; @@ -156,7 +156,7 @@ applyVote(ApplyContext& ctx, Sandbox& sb, AccountID const& account, beast::Journ sfVoteWeight, static_cast( Number(lpTokensNew) * kVoteWeightScaleFactor / lptAMMBalance)); - newEntry.setAccountID(sfAccount, account); + newEntry.setAccountID(sfAccount, accountID); num += feeNew * lpTokensNew; den += lpTokensNew; if (minPos) diff --git a/src/libxrpl/tx/transactors/lending/LoanPay.cpp b/src/libxrpl/tx/transactors/lending/LoanPay.cpp index 89e7bee60b..12a0212b72 100644 --- a/src/libxrpl/tx/transactors/lending/LoanPay.cpp +++ b/src/libxrpl/tx/transactors/lending/LoanPay.cpp @@ -99,7 +99,7 @@ LoanPay::calculateBaseFee(ReadView const& view, STTx const& tx) if (loanSle->at(sfPaymentRemaining) <= kLoanPaymentsPerFeeIncrement) { - // If there are fewer than loanPaymentsPerFeeIncrement payments left to + // If there are fewer than kLoanPaymentsPerFeeIncrement payments left to // pay, we can skip the computations. return normalCost; } diff --git a/src/test/app/AMMMPT_test.cpp b/src/test/app/AMMMPT_test.cpp index 4d073d0188..eba388e5fd 100644 --- a/src/test/app/AMMMPT_test.cpp +++ b/src/test/app/AMMMPT_test.cpp @@ -7037,7 +7037,7 @@ private: } // This test validates both invariant changes work together for - // the specific case of MPT/MPT pools with > maxDeletableAMMTrustLines. + // the specific case of MPT/MPT pools with > kMaxDeletableAmmTrustLines. { Env env( *this, diff --git a/src/test/app/Invariants_test.cpp b/src/test/app/Invariants_test.cpp index 4b24f83180..775e18656b 100644 --- a/src/test/app/Invariants_test.cpp +++ b/src/test/app/Invariants_test.cpp @@ -182,7 +182,7 @@ class Invariants_test : public beast::unit_test::Suite // Invariants normally run in the Transaction's "apply" (operator()) context, and can always // access global Rules. - CurrentTransactionRulesGuard const rg(ov.rules()); + CurrentTransactionRulesGuard const rulesGuard(ov.rules()); BEAST_EXPECT(precheck(a1, a2, ac)); diff --git a/src/xrpld/app/misc/NetworkOPs.cpp b/src/xrpld/app/misc/NetworkOPs.cpp index 343f5dff94..d6f9d10f05 100644 --- a/src/xrpld/app/misc/NetworkOPs.cpp +++ b/src/xrpld/app/misc/NetworkOPs.cpp @@ -4549,7 +4549,7 @@ NetworkOPsImp::getBookPage( uOfferOwnerID, book.out.currency, book.out.account, - FreezeHandling::fhZERO_IF_FROZEN); + FreezeHandling::ZeroIfFrozen); if (saOwnerFunds.isNegative()) { diff --git a/src/xrpld/app/misc/detail/TxQ.cpp b/src/xrpld/app/misc/detail/TxQ.cpp index d23aca8744..0f70f17046 100644 --- a/src/xrpld/app/misc/detail/TxQ.cpp +++ b/src/xrpld/app/misc/detail/TxQ.cpp @@ -395,7 +395,7 @@ TxQ::canBeHeld( // PreviousTxnID is deprecated and should never be used. // AccountTxnID is not supported by the transaction // queue yet, but should be added in the future. - // tapFAIL_HARD transactions are never held + // TapFailHard transactions are never held if (tx.isFieldPresent(sfPreviousTxnID) || tx.isFieldPresent(sfAccountTxnID) || ((flags & TapFailHard) != 0u)) return telCAN_NOT_QUEUE;