Repository navigation
Conversation
There was a problem hiding this comment.
This is a clean, mechanical refactor moving checkReserve from free functions to const members of AccountRootEntry. I traced every call site against the two new member overload signatures (with-sponsor+insufReserveCode, and derive-sponsor-internally) and found the parameter mapping consistent everywhere — no argument-order swaps, no dropped sponsor/insufReserveCode arguments relative to the original behavior, and the journal is correctly threaded into entry constructors instead of the removed function parameter. No new correctness, security, or resource-management issues were introduced by the changed (+) lines.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
4a22287 to
0a8f1ea
Compare
There was a problem hiding this comment.
This is a mechanical, well-executed refactor moving the two checkReserve free functions onto AccountRootEntry as const member functions. I traced every changed call site against its prior free-function invocation (EscrowHelpers, MPTokenHelpers, RippleStateHelpers, SignerListSet, CheckCash, CheckCreate, CredentialAccept, CredentialCreate, DelegateSet, EscrowCreate, DepositPreauth, PaymentChannelCreate/Fund, TransactionProposalCreate, SponsorshipSet/Transfer, MPTokenIssuanceCreate, TrustSet) and the argument lists line up 1:1 with the removed calls (accSle/journal args dropped, remaining args and defaults preserved). The new AccountRootEntry.cpp implementation is a verbatim copy of the old AccountRootHelpers.cpp body, and the second overload correctly derives the sponsor via getEffectiveTxReserveSponsor(ctx, *this) exactly as before. Entry constructions that gained an explicit journal argument are consistent with entries that are later used for checkReserve or other journal-consuming operations. No behavioral divergence, resource leak, or logic error was found in the changed (+) lines.
0a8f1ea to
2da8ca1
Compare
2da8ca1 to
a7ec004
Compare
Replace both entry-taking checkReserve free functions with const members of AccountRootEntry. The members keep the ApplyViewContext parameter, because the check needs the transaction, and drop the journal parameter: call sites pass their journal to the entry constructor instead.
a7ec004 to
654edc9
Compare
|
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. |
There was a problem hiding this comment.
This is a mechanical, well-executed refactor moving checkReserve from free functions onto AccountRootEntry as member functions. I traced every call site update against the original free-function invocation (argument order, default insufReserveCode handling, sponsor-explicit vs sponsor-implicit overload selection, and the journal param moving from checkReserve to the entry constructor) and found them all consistent with the pre-refactor behavior. No logic changes, no argument-order mix-ups, no dropped parameters. The author's claim of 'no behavior change' holds up under review.
…rch/accountroot-checkReserve # Conflicts: # src/libxrpl/tx/transactors/check/CheckCash.cpp # src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp # src/libxrpl/tx/transactors/payment_channel/PaymentChannelFund.cpp # src/libxrpl/tx/transactors/token/MPTokenIssuanceCreate.cpp
…rch/accountroot-checkReserve
High Level Overview of Change
Replaces both entry-taking
checkReservefree functions with const members ofAccountRootEntry:checkReserve(ctx, accBalance, sponsorSle, adj, insufReserveCode)andcheckReserve(ctx, accBalance, adj). The members keep theApplyViewContextparameter, because the check needs the transaction. The journal parameter goes away: call sites pass their journal to the entry constructor instead.Context of Change
Part of the Wrapped SLEs migration (design: step 2/3 of #7886). The reserve 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 #8387; 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