Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
This is a clean, mechanical refactor consistent with its stated intent: it adds a const maxAmount() member to MPTokenIssuanceEntry that forwards to the existing free function maxMPTAmount(SLE const&), and swaps call sites that already hold a typed issuance entry to use the member instead. The new .cpp's **this correctly resolves to this->operator*() (returning the underlying SLE), matching the free function's signature, so there's no behavior change or recursion bug. The SLEBase.cpp macro change (definition → extern declaration) is explained in an inline comment and is a reasonable, deliberate accommodation for entries with out-of-line member bodies. No changed lines exhibit logic errors, resource issues, or security concerns; I found nothing worth flagging.
2194e6d to
dee799e
Compare
be53bb7 to
0a40c8e
Compare
There was a problem hiding this comment.
This is a clean, mechanical refactor consistent with its stated goal: MPTokenIssuanceEntry::maxAmount() is added as a thin wrapper around the existing free maxMPTAmount(SLE const&), and all call sites that already hold an issuance entry are updated to use the member instead. The new .cpp correctly explicit-instantiates both ReadView/ApplyView specializations, and the **this dereference pattern matches the existing *sleIssuance/*sle usage at the old call sites, so there's no behavioral change. The SLEBase.cpp test macro rework (dropping per-entry explicit instantiation in favor of a static_assert-driven instantiation plus a new constructibility check) is well-explained by the added comment and is consistent with the stacked-PR migration context. No correctness, security, or consistency issues found in the changed (+) lines.
Add the const member MPTokenIssuanceEntry::maxAmount() and use it at every call site that already holds an issuance entry. The member body lives in the new src/libxrpl/ledger/entries/MPTokenIssuanceEntry.cpp, which explicitly instantiates the read-only and writable entries. The free maxMPTAmount(SLE const&) stays and holds the implementation: ValidMPTBalanceChanges::visitEntry and the RPC AssetCache call it with a bare SLE and no view, so they cannot build an entry.
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
0a40c8e to
3340faa
Compare
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
High Level Overview of Change
Adds the const member
MPTokenIssuanceEntry::maxAmount()and uses it at every call site that already holds an issuance entry (MPTokenHelpers.cpp,TokenHelpers.cpp,MPTEndpointStep.cpp). The member body lives in the newsrc/libxrpl/ledger/entries/MPTokenIssuanceEntry.cpp, which explicitly instantiatesMPTokenIssuanceEntry<ReadView>andMPTokenIssuanceEntry<ApplyView>.Context of Change
Part of the Wrapped SLEs migration (design: step 2/3 of #7886). Issuance-specific logic now lives on the typed wrapper, so the compiler rejects calls with the wrong entry type. The free
maxMPTAmount(SLE const&)stays and holds the implementation, becauseValidMPTBalanceChanges::visitEntry(invariant) and the RPCAssetCachecall it with a bare SLE and no view; the member calls it. Pure refactor: no amendment, no behavior change; any observable difference is a bug.Stacked on #8374; review only the last commit. The commit before it is a cherry-pick of the MSVC C4661 fix from #8357 (needed because this PR adds out-of-line entry members); it drops out when #8357 merges.
This PR was fully written by AI (Claude Code) under human direction; the human author reviewed the diff.
API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)Test Plan
Syntax-checked (
clang++ -fsyntax-onlywith project flags) the newMPTokenIssuanceEntry.cppand all 48 .cpp files that includeMPTokenIssuanceEntry.horMPTokenHelpers.h; clang-tidy clean on the changed files; pre-commit clean. No new tests. CI runs the full unit test suite.🤖 Generated with Claude Code