Repository navigation
Conversation
There was a problem hiding this comment.
Clean mechanical refactor moving decreaseOwnerCount to a writable member of AccountRootEntry, mirroring the increaseOwnerCount pattern already established. Call sites were updated consistently across RippleStateHelpers.cpp, TokenHelpers.cpp, OracleSet.cpp, and TrustSet.cpp — entry constructors now pass the journal so the member can drop the separate view/journal parameters, and the AccountID-shim overload and decreaseOwnerCountForObject were updated to delegate to the new member. No behavioral divergence from the prior free function is apparent; the assertion, bounds check, and delegation to adjustOwnerCountSigned are preserved verbatim. No correctness, security, or consistency issues found in the changed lines.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
f221d6c to
504da68
Compare
There was a problem hiding this comment.
Clean, mechanical refactor that moves decreaseOwnerCount onto AccountRootEntry as a writable member, mirroring the existing increaseOwnerCount pattern, and removes the now-unnecessary friend declaration. Traced every call site (RippleStateHelpers, TokenHelpers, OracleSet, TrustSet, AccountRootHelpers) and the journal passed to each entry constructor matches the journal previously passed explicitly to the free function, so there's no behavioral drift. The AccountID-based overload shim and decreaseOwnerCountForObject correctly delegate to the new member. No correctness, security, or consistency issues found in the changed lines.
504da68 to
398fd76
Compare
398fd76 to
789145a
Compare
Replace the entry-taking decreaseOwnerCount free function with a writable member of AccountRootEntry, and drop the temporary friend declaration from the previous change. The member uses the entry's view and journal, so call sites pass their journal to the entry constructor. The AccountID-based overload stays as a shim.
789145a to
16389dc
Compare
There was a problem hiding this comment.
This is a clean, mechanical refactor that moves decreaseOwnerCount from a free function onto AccountRootEntry as a writable member, removing the temporary friend declaration from #8423. I traced each call site to confirm the journal value now passed into the AccountRootEntryW/AccountRootEntry constructor matches the journal that was previously passed directly to the free function call (RippleStateHelpers.cpp, TokenHelpers.cpp, AccountRootHelpers.h shim, deleteAMMTrustLine's ternary-selected entry), and the moved implementation in AccountRootEntry.cpp is a faithful copy of the original logic (same assert, same bounds check, same delegation to adjustOwnerCountSigned). No behavior changes were introduced on any added/changed line.
…dari/rearch/accountroot-decreaseOwnerCount
…dari/rearch/accountroot-decreaseOwnerCount
…dari/rearch/accountroot-decreaseOwnerCount # Conflicts: # src/libxrpl/ledger/helpers/AccountRootHelpers.cpp
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
High Level Overview of Change
Replaces the entry-taking
decreaseOwnerCount(view, accountSle, sponsorSle, count, j)free function with the writable memberAccountRootEntry::decreaseOwnerCount(sponsorSle, count), and removes the temporaryfrienddeclaration added in #8423. The member uses the entry's view and journal, so call sites pass their journal to the entry constructor. TheAccountID-based overload stays as a shim.decreaseOwnerCountForObjectstays a free function (a later pass moves it) and now calls the member.Context of Change
Part of the Wrapped SLEs migration (design: step 2/3 of #7886). Owner-count updates now need a writable
AccountRootEntryW, so the compiler rejects them on a read-only entry. Pure refactor: no amendment, no behavior change; any observable difference is a bug.Stacked on #8423; 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
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)Test Plan
Syntax-checked (
clang++ -fsyntax-onlywith project flags) every changed.cppand every.cppthat includesAccountRootEntry.horAccountRootHelpers.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