Skip to content

refactor: Move availableMPTAmount onto MPTokenIssuanceEntry - #8377

Open
mvadari wants to merge 6 commits into
mvadari/rearch/mptokenissuance-maxMPTAmountfrom
mvadari/rearch/mptokenissuance-availableMPTAmount
Open

mvadari wants to merge 6 commits into
mvadari/rearch/mptokenissuance-maxMPTAmountfrom
mvadari/rearch/mptokenissuance-availableMPTAmount

Conversation

@mvadari

@mvadari mvadari commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Moves availableMPTAmount(MPTokenIssuanceEntryR const&) onto the wrapper as the const member MPTokenIssuanceEntry::availableAmount() (inline in the header). The free entry overload is deleted and its callers in MPTokenHelpers.cpp and TokenHelpers.cpp now call the member. The availableMPTAmount(ReadView const&, MPTID const&) overload stays as a shim that builds the entry, throws if it is missing (as before), and calls the member.

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. Pure refactor: no amendment, no behavior change; any observable difference is a bug.

Stacked on #8375; review only the last commit.

This PR was fully written by AI (Claude Code) under human direction; the human author reviewed the diff.

API Impact

  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)

Test Plan

Syntax-checked (clang++ -fsyntax-only with project flags) MPTokenIssuanceEntry.cpp and all 48 .cpp files that include MPTokenIssuanceEntry.h or MPTokenHelpers.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

@ripple-ai-reviewer ripple-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pure mechanical refactor moving availableMPTAmount onto MPTokenIssuanceEntry as a const member and updating call sites. The logic is copied verbatim (max - outstanding), and the ReadView/MPTID shim still throws as before. No behavior change is evident, and callers were updated consistently across MPTokenHelpers.cpp and TokenHelpers.cpp.

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mvadari
mvadari force-pushed the mvadari/rearch/mptokenissuance-availableMPTAmount branch from 408591e to 092f77f Compare September 30, 2026 18:00
@mvadari
mvadari added this pull request to stack #8451 September 30, 2026 18:03
@mvadari
mvadari force-pushed the mvadari/rearch/mptokenissuance-availableMPTAmount branch from 092f77f to 3626018 Compare October 5, 2026 13:59
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

@mvadari
mvadari force-pushed the mvadari/rearch/mptokenissuance-availableMPTAmount branch from 3626018 to 8fa25ee Compare October 5, 2026 14:49
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

@ripple-ai-reviewer ripple-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pure mechanical refactor moving availableMPTAmount onto MPTokenIssuanceEntry as an inline member. The new availableAmount() implementation is a faithful move of the old free-function body: maxAmount() is still called first and sfOutstandingAmount is still read via the same double-dereference pattern (**this ≡ old *sleIssuance), so there's no behavioral change at the call sites in MPTokenHelpers.cpp and TokenHelpers.cpp. No new issues identified in the changed lines.

Replace the free availableMPTAmount(MPTokenIssuanceEntryR const&) with
the const member MPTokenIssuanceEntry::availableAmount(). The
(ReadView, MPTID) overload stays as a shim that builds the entry,
throws if it is missing, and calls the member.
@github-actions

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

@mvadari
mvadari force-pushed the mvadari/rearch/mptokenissuance-availableMPTAmount branch from 8fa25ee to 5eedd7c Compare November 10, 2026 00:49
@github-actions

Copy link
Copy Markdown

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

@ripple-ai-reviewer ripple-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found.

@ripple-ai-reviewer ripple-ai-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant