From 4cbc0502a157102af891357ea949ea9efb3ad011 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Mon, 29 Jun 2026 20:33:46 -0400 Subject: [PATCH] fix clang-tidy --- include/xrpl/ledger/View.h | 2 +- include/xrpl/ledger/helpers/EscrowHelpers.h | 6 +++--- include/xrpl/ledger/helpers/MPTokenHelpers.h | 8 ++++---- include/xrpl/ledger/helpers/RippleStateHelpers.h | 4 ++-- include/xrpl/ledger/helpers/SponsorHelpers.h | 2 +- include/xrpl/ledger/helpers/TokenHelpers.h | 4 ++-- include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h | 2 +- src/libxrpl/ledger/View.cpp | 2 +- src/libxrpl/ledger/helpers/MPTokenHelpers.cpp | 8 ++++---- src/libxrpl/ledger/helpers/RippleStateHelpers.cpp | 4 ++-- src/libxrpl/ledger/helpers/TokenHelpers.cpp | 4 ++-- .../tx/transactors/token/MPTokenIssuanceCreate.cpp | 2 +- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/xrpl/ledger/View.h b/include/xrpl/ledger/View.h index 968923b50b..95581b7527 100644 --- a/include/xrpl/ledger/View.h +++ b/include/xrpl/ledger/View.h @@ -201,7 +201,7 @@ canWithdraw(ReadView const& view, STTx const& tx); [[nodiscard]] TER doWithdraw( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& senderAcct, AccountID const& dstAcct, AccountID const& sourceAcct, diff --git a/include/xrpl/ledger/helpers/EscrowHelpers.h b/include/xrpl/ledger/helpers/EscrowHelpers.h index c1f488c4b9..11282fad74 100644 --- a/include/xrpl/ledger/helpers/EscrowHelpers.h +++ b/include/xrpl/ledger/helpers/EscrowHelpers.h @@ -17,7 +17,7 @@ namespace xrpl { template TER escrowUnlockApplyHelper( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, Rate lockedRate, SLE::ref sleDest, STAmount const& xrpBalance, @@ -31,7 +31,7 @@ escrowUnlockApplyHelper( template <> inline TER escrowUnlockApplyHelper( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, Rate lockedRate, SLE::ref sleDest, STAmount const& xrpBalance, @@ -168,7 +168,7 @@ escrowUnlockApplyHelper( template <> inline TER escrowUnlockApplyHelper( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, Rate lockedRate, SLE::ref sleDest, STAmount const& xrpBalance, diff --git a/include/xrpl/ledger/helpers/MPTokenHelpers.h b/include/xrpl/ledger/helpers/MPTokenHelpers.h index 370efe5342..e0958ad992 100644 --- a/include/xrpl/ledger/helpers/MPTokenHelpers.h +++ b/include/xrpl/ledger/helpers/MPTokenHelpers.h @@ -71,7 +71,7 @@ canAddHolding(ReadView const& view, MPTIssue const& mptIssue); [[nodiscard]] TER authorizeMPToken( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, XRPAmount const& priorBalance, MPTID const& mptIssuanceID, AccountID const& account, @@ -102,7 +102,7 @@ requireAuth( */ [[nodiscard]] TER enforceMPTokenAuthorization( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, MPTID const& mptIssuanceID, AccountID const& account, XRPAmount const& priorBalance, @@ -188,7 +188,7 @@ canMPTTradeAndTransfer( [[nodiscard]] TER addEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, XRPAmount priorBalance, MPTIssue const& mptIssue, @@ -196,7 +196,7 @@ addEmptyHolding( [[nodiscard]] TER removeEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, MPTIssue const& mptIssue, beast::Journal journal); diff --git a/include/xrpl/ledger/helpers/RippleStateHelpers.h b/include/xrpl/ledger/helpers/RippleStateHelpers.h index c6f66543a9..907455f522 100644 --- a/include/xrpl/ledger/helpers/RippleStateHelpers.h +++ b/include/xrpl/ledger/helpers/RippleStateHelpers.h @@ -229,7 +229,7 @@ canTransfer(ReadView const& view, Issue const& issue, AccountID const& from, Acc /// canAddHolding() in preflight with the same View and Asset [[nodiscard]] TER addEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, XRPAmount priorBalance, Issue const& issue, @@ -237,7 +237,7 @@ addEmptyHolding( [[nodiscard]] TER removeEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, Issue const& issue, beast::Journal journal); diff --git a/include/xrpl/ledger/helpers/SponsorHelpers.h b/include/xrpl/ledger/helpers/SponsorHelpers.h index ee7121b9ae..d85a82ff54 100644 --- a/include/xrpl/ledger/helpers/SponsorHelpers.h +++ b/include/xrpl/ledger/helpers/SponsorHelpers.h @@ -35,7 +35,7 @@ getTxReserveSponsorAccountID(STTx const& tx) } inline std::expected -getTxReserveSponsor(ApplyViewContext&& ctx) +getTxReserveSponsor(ApplyViewContext const& ctx) { auto const sponsorID = getTxReserveSponsorAccountID(ctx.tx); if (sponsorID) diff --git a/include/xrpl/ledger/helpers/TokenHelpers.h b/include/xrpl/ledger/helpers/TokenHelpers.h index e061d48aab..e6a3bc17f8 100644 --- a/include/xrpl/ledger/helpers/TokenHelpers.h +++ b/include/xrpl/ledger/helpers/TokenHelpers.h @@ -230,7 +230,7 @@ canAddHolding(ReadView const& view, Asset const& asset); [[nodiscard]] TER addEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, XRPAmount priorBalance, Asset const& asset, @@ -238,7 +238,7 @@ addEmptyHolding( [[nodiscard]] TER removeEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, Asset const& asset, beast::Journal journal); diff --git a/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h b/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h index f1189fe530..359e306c14 100644 --- a/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h +++ b/include/xrpl/tx/transactors/token/MPTokenIssuanceCreate.h @@ -63,7 +63,7 @@ public: beast::Journal const& j) override; static std::expected - create(ApplyViewContext&& ctx, beast::Journal journal, MPTCreateArgs const& args); + create(ApplyViewContext const& ctx, beast::Journal journal, MPTCreateArgs const& args); }; } // namespace xrpl diff --git a/src/libxrpl/ledger/View.cpp b/src/libxrpl/ledger/View.cpp index 78c8417695..27d55e0eb3 100644 --- a/src/libxrpl/ledger/View.cpp +++ b/src/libxrpl/ledger/View.cpp @@ -432,7 +432,7 @@ canWithdraw(ReadView const& view, STTx const& tx) TER doWithdraw( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& senderAcct, AccountID const& dstAcct, AccountID const& sourceAcct, diff --git a/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp b/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp index 20417e7e44..a85804c4fc 100644 --- a/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp +++ b/src/libxrpl/ledger/helpers/MPTokenHelpers.cpp @@ -125,7 +125,7 @@ canAddHolding(ReadView const& view, MPTIssue const& mptIssue) [[nodiscard]] TER addEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, XRPAmount priorBalance, MPTIssue const& mptIssue, @@ -149,7 +149,7 @@ addEmptyHolding( [[nodiscard]] TER authorizeMPToken( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, XRPAmount const& priorBalance, MPTID const& mptIssuanceID, AccountID const& account, @@ -280,7 +280,7 @@ authorizeMPToken( [[nodiscard]] TER removeEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, MPTIssue const& mptIssue, beast::Journal journal) @@ -412,7 +412,7 @@ requireAuth( [[nodiscard]] TER enforceMPTokenAuthorization( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, MPTID const& mptIssuanceID, AccountID const& account, XRPAmount const& priorBalance, // for MPToken authorization diff --git a/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp b/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp index 083adf2db9..78e4585720 100644 --- a/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp +++ b/src/libxrpl/ledger/helpers/RippleStateHelpers.cpp @@ -633,7 +633,7 @@ canTransfer(ReadView const& view, Issue const& issue, AccountID const& from, Acc TER addEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, XRPAmount priorBalance, Issue const& issue, @@ -699,7 +699,7 @@ addEmptyHolding( TER removeEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, Issue const& issue, beast::Journal journal) diff --git a/src/libxrpl/ledger/helpers/TokenHelpers.cpp b/src/libxrpl/ledger/helpers/TokenHelpers.cpp index 5448aa1fe6..3cf7387e45 100644 --- a/src/libxrpl/ledger/helpers/TokenHelpers.cpp +++ b/src/libxrpl/ledger/helpers/TokenHelpers.cpp @@ -473,7 +473,7 @@ canAddHolding(ReadView const& view, Asset const& asset) TER addEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, XRPAmount priorBalance, Asset const& asset, @@ -489,7 +489,7 @@ addEmptyHolding( TER removeEmptyHolding( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, AccountID const& accountID, Asset const& asset, beast::Journal journal) diff --git a/src/libxrpl/tx/transactors/token/MPTokenIssuanceCreate.cpp b/src/libxrpl/tx/transactors/token/MPTokenIssuanceCreate.cpp index 3235638b75..9d57cb7980 100644 --- a/src/libxrpl/tx/transactors/token/MPTokenIssuanceCreate.cpp +++ b/src/libxrpl/tx/transactors/token/MPTokenIssuanceCreate.cpp @@ -104,7 +104,7 @@ MPTokenIssuanceCreate::preflight(PreflightContext const& ctx) std::expected MPTokenIssuanceCreate::create( - ApplyViewContext&& ctx, + ApplyViewContext const& ctx, beast::Journal journal, MPTCreateArgs const& args) {