Skip to content

refactor: Move checkDestinationAndTag onto AccountRootEntry - #8437

Open
mvadari wants to merge 8 commits into
mvadari/rearch/accountroot-createPseudoAccountfrom
mvadari/rearch/accountroot-checkDestinationAndTag
Open

mvadari wants to merge 8 commits into
mvadari/rearch/accountroot-createPseudoAccountfrom
mvadari/rearch/accountroot-checkDestinationAndTag

Conversation

@mvadari

@mvadari mvadari commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Replaces the entry-taking checkDestinationAndTag(AccountRootEntryR const& toSle, bool hasDestinationTag) free function with the const member AccountRootEntry::checkDestinationAndTag(bool hasDestinationTag). The body is short, so it is inline in the header. The only caller is canWithdraw in View.cpp.

Context of Change

Part of the Wrapped SLEs migration (design: step 2/3 of #7886). The check now lives on the typed entry, so it cannot be called with an SLE of the wrong type. Pure refactor: no amendment, no behavior change; any observable difference is a bug.

Stacked on #8436; 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) every changed .cpp and every .cpp that includes AccountRootEntry.h or AccountRootHelpers.h (98/98 passed). clang-tidy clean on all changed files and headers; 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.

Clean, mechanical refactor moving checkDestinationAndTag from a free function taking an AccountRootEntryR into an inline const member on AccountRootEntry, with the single caller in View.cpp updated accordingly. Logic is preserved verbatim (exists check, RequireDestTag flag check, tesSUCCESS fallthrough), includes are correctly pruned (TER.h no longer needed in the two files that dropped the free function), and no behavior change is introduced. No issues found.

@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/accountroot-checkDestinationAndTag branch from 1d82d79 to 73e04ca Compare September 30, 2026 17:58
@mvadari
mvadari added this pull request to stack #8448 September 30, 2026 17:59
@mvadari
mvadari force-pushed the mvadari/rearch/accountroot-checkDestinationAndTag branch from 73e04ca to 67f49c2 Compare October 5, 2026 13:59
Replace the entry-taking checkDestinationAndTag free function with the
const member AccountRootEntry::checkDestinationAndTag(hasDestinationTag).
The body is short, so it is inline in the header.
@mvadari
mvadari force-pushed the mvadari/rearch/accountroot-checkDestinationAndTag branch from 67f49c2 to 95323ed Compare October 5, 2026 14:53

@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.

Clean, mechanical refactor moving checkDestinationAndTag from a free function in AccountRootHelpers to a const member on AccountRootEntry, with the single caller in View.cpp updated accordingly. Logic is preserved verbatim (same checks, same return codes), and unused includes (TER.h) are correctly dropped from files that no longer need them. No behavioral change, no issues found.

…adari/rearch/accountroot-checkDestinationAndTag

# Conflicts:
#	src/libxrpl/ledger/View.cpp
…adari/rearch/accountroot-checkDestinationAndTag
…adari/rearch/accountroot-checkDestinationAndTag
@github-actions

Copy link
Copy Markdown

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

@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.

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