Skip to content

refactor: Move isPseudoAccount onto AccountRootEntry - #8433

Open
mvadari wants to merge 7 commits into
mvadari/rearch/accountroot-decreaseOwnerCountfrom
mvadari/rearch/accountroot-isPseudoAccount
Open

mvadari wants to merge 7 commits into
mvadari/rearch/accountroot-decreaseOwnerCountfrom
mvadari/rearch/accountroot-isPseudoAccount

Conversation

@mvadari

@mvadari mvadari commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Replaces the entry-taking isPseudoAccount(AccountRootEntryR const&) free function with the const member AccountRootEntry::isPseudoAccount(). The isPseudoAccount(view, AccountID) overload stays as a one-line shim. The invariant-only isPseudoAccountSle(SLE) helper in InvariantCheck.cpp is unchanged; VaultInvariant.cpp changes only because its one call used the removed overload.

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 #8427; 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, plus VaultInvariant.cpp). 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

@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-isPseudoAccount branch from 8c90185 to 3debac2 Compare September 30, 2026 14:29

@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 isPseudoAccount from a free function taking AccountRootEntryR into a const member on AccountRootEntry, with all ~15 call sites updated consistently (sle.isPseudoAccount() instead of isPseudoAccount(sle)) and the now-unused AccountRootHelpers.h includes dropped where appropriate. The member implementation is a verbatim copy of the old free-function body (same exists()/getType()/any_of logic), and the remaining view+AccountID overload correctly delegates to the new member. No behavioral change is evident in the diff; call sites that previously null-checked before calling (e.g. TrustSet.cpp's sleDst && ...) preserve that check. Nothing here rises to a confident bug, security, or correctness issue.

@mvadari
mvadari force-pushed the mvadari/rearch/accountroot-isPseudoAccount branch from 3debac2 to 0001d6a 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-isPseudoAccount branch from 0001d6a to d9efc2c Compare October 5, 2026 13:58
Replace the entry-taking isPseudoAccount free function with the const
member AccountRootEntry::isPseudoAccount(). The (view, AccountID)
overload stays as a one-line shim. The invariant-only
isPseudoAccountSle(SLE) helper is unchanged; VaultInvariant.cpp changes
only because its call used the removed overload.
@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/accountroot-isPseudoAccount branch from d9efc2c to d21cf46 Compare October 5, 2026 14:52
@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.

Clean, mechanical refactor moving isPseudoAccount from a free function taking AccountRootEntryR to a const member on AccountRootEntry. The new member's logic (this->exists() && getType() == ltACCOUNT_ROOT && any_of over pseudo-account fields) is identical to the removed free function's logic, just rebased onto this. All call sites were updated consistently to use the member syntax, the one-line view/AccountID overload shim correctly delegates to the new member, and now-unused AccountRootHelpers.h includes were pruned from files that no longer need them. I didn't find any correctness, security, or consistency issues introduced by this change.

…dari/rearch/accountroot-isPseudoAccount

# Conflicts:
#	src/libxrpl/ledger/helpers/SponsorHelpers.cpp
#	src/libxrpl/tx/invariants/VaultInvariant.cpp
#	src/libxrpl/tx/transactors/check/CheckCreate.cpp
#	src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp
@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.

@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