Sponsored Content
Skip to content

refactor: Rename account_ to accountID_ - #7284

Merged
bthomee merged 1 commit into
developfrom
mvadari/accountid_
May 18, 2026
Merged

refactor: Rename account_ to accountID_#7284
bthomee merged 1 commit into
developfrom
mvadari/accountid_

Conversation

@mvadari

@mvadari mvadari commented May 15, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

This PR renames the account_ field in Transactor to accountID_ (as well as in a couple of other classes that are used by transactors).

Context of Change

In preparation for #6620 - will simplify that PR

API Impact

N/A

@mvadari
mvadari requested review from Tapanito and Copilot May 15, 2026 21:43
@mvadari mvadari added the Trivial Simple change with minimal effect, or already tested. Only needs one approval. label May 15, 2026

@xrplf-ai-reviewer xrplf-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.

Review by Claude Opus 4.6 · Prompt: V15

Copilot AI 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.

Pull request overview

This PR is a mechanical refactor to rename the Transactor protected member account_ to accountID_, and propagate that rename through transactors and a couple of related helper/context classes. This is intended to reduce ambiguity (since the type is AccountID) and to simplify follow-on refactoring work (notably #6620’s type-safety effort).

Changes:

  • Renamed Transactor::account_ to Transactor::accountID_ and updated core Transactor logic accordingly.
  • Updated a broad set of transactors (vault, token, payment, escrow, lending, DEX/AMM, etc.) to use accountID_ in place of account_.
  • Renamed similar members in AMMContext and TOffer to keep terminology consistent.

Reviewed changes

Copilot reviewed 52 out of 52 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/libxrpl/tx/transactors/vault/VaultWithdraw.cpp Replace account_ usage with accountID_ in vault withdraw flow.
src/libxrpl/tx/transactors/vault/VaultDeposit.cpp Replace account_ usage with accountID_ in vault deposit flow.
src/libxrpl/tx/transactors/vault/VaultDelete.cpp Replace account_ usage with accountID_ in vault delete flow/logging.
src/libxrpl/tx/transactors/vault/VaultCreate.cpp Replace account_ usage with accountID_ for vault creation and linking.
src/libxrpl/tx/transactors/vault/VaultClawback.cpp Replace account_ usage with accountID_ in clawback flow.
src/libxrpl/tx/transactors/token/TrustSet.cpp Replace account_ usage with accountID_ in TrustSet logic.
src/libxrpl/tx/transactors/token/MPTokenIssuanceDestroy.cpp Replace account_ usage with accountID_ for issuer checks and owner dir removal.
src/libxrpl/tx/transactors/token/MPTokenIssuanceCreate.cpp Replace account_ usage with accountID_ in submitting account info.
src/libxrpl/tx/transactors/token/MPTokenAuthorize.cpp Replace account_ usage with accountID_ for authorization.
src/libxrpl/tx/transactors/system/TicketCreate.cpp Replace account_ usage with accountID_ for ticket creation/dir insertion.
src/libxrpl/tx/transactors/system/Change.cpp Replace account_ usage with accountID_ in invariants/assertion.
src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.cpp Replace account_ usage with accountID_ for PD creation and owner dir insertion.
src/libxrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.cpp Replace account_ usage with accountID_ for owner dir removal and owner lookup.
src/libxrpl/tx/transactors/payment/Payment.cpp Replace account_ usage with accountID_ across payment/MPT checks and deposit preauth.
src/libxrpl/tx/transactors/payment/DepositPreauth.cpp Replace account_ usage with accountID_ in keylets, SLE fields, and dir insertion.
src/libxrpl/tx/transactors/oracle/OracleSet.cpp Replace account_ usage with accountID_ for oracle keylet and owner dir insertion.
src/libxrpl/tx/transactors/oracle/OracleDelete.cpp Replace account_ usage with accountID_ for oracle lookup/deletion.
src/libxrpl/tx/transactors/nft/NFTokenMint.cpp Replace account_ usage with accountID_ for issuer fallback and NFT insertion.
src/libxrpl/tx/transactors/nft/NFTokenAcceptOffer.cpp Replace account_ usage with accountID_ in buyer/seller selection and broker fee payment.
src/libxrpl/tx/transactors/lending/LoanSet.cpp Replace account_ usage with accountID_ for borrower selection and assertions.
src/libxrpl/tx/transactors/lending/LoanPay.cpp Replace account_ usage with accountID_ in balance checks/transfers and assertions.
src/libxrpl/tx/transactors/lending/LoanBrokerSet.cpp Replace account_ usage with accountID_ in broker creation/linking.
src/libxrpl/tx/transactors/lending/LoanBrokerDelete.cpp Replace account_ usage with accountID_ in dir removal, payouts, and owner lookup.
src/libxrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.cpp Replace account_ usage with accountID_ in destination defaulting and withdraw call.
src/libxrpl/tx/transactors/lending/LoanBrokerCoverDeposit.cpp Replace account_ usage with accountID_ in deposit transfer.
src/libxrpl/tx/transactors/escrow/EscrowFinish.cpp Replace account_ usage with accountID_ in deposit preauth and asset-creation logic.
src/libxrpl/tx/transactors/escrow/EscrowCreate.cpp Replace account_ usage with accountID_ for escrow keylets, SLE fields, and owner dirs.
src/libxrpl/tx/transactors/escrow/EscrowCancel.cpp Replace account_ usage with accountID_ in unlock helper selection logic.
src/libxrpl/tx/transactors/did/DIDSet.cpp Replace account_ usage with accountID_ in DID keylet/SLE creation and addSLE.
src/libxrpl/tx/transactors/did/DIDDelete.cpp Replace account_ usage with accountID_ in DID deletion.
src/libxrpl/tx/transactors/dex/OfferCreate.cpp Replace account_ usage with accountID_ across crossing/apply logic and keylets.
src/libxrpl/tx/transactors/dex/OfferCancel.cpp Replace account_ usage with accountID_ for account/offer lookups.
src/libxrpl/tx/transactors/dex/AMMWithdraw.cpp Replace account_ usage with accountID_ in LP balance checks and withdraw path.
src/libxrpl/tx/transactors/dex/AMMVote.cpp Replace account_ usage with accountID_ in vote application.
src/libxrpl/tx/transactors/dex/AMMDeposit.cpp Replace account_ usage with accountID_ across deposit flow and LP-related logic.
src/libxrpl/tx/transactors/dex/AMMCreate.cpp Replace account_ usage with accountID_ in create application.
src/libxrpl/tx/transactors/dex/AMMBid.cpp Replace account_ usage with accountID_ in bid application.
src/libxrpl/tx/transactors/delegate/DelegateSet.cpp Replace account_ usage with accountID_ in delegate keylet/SLE/dir insertion.
src/libxrpl/tx/transactors/credentials/CredentialDelete.cpp Replace account_ usage with accountID_ in subject/issuer fallbacks and checks.
src/libxrpl/tx/transactors/credentials/CredentialCreate.cpp Replace account_ usage with accountID_ in keylets, SLE fields, and owner dir insertion.
src/libxrpl/tx/transactors/credentials/CredentialAccept.cpp Replace account_ usage with accountID_ for subject lookup and credential keylet.
src/libxrpl/tx/transactors/check/CheckCreate.cpp Replace account_ usage with accountID_ in keylets, SLE fields, and owner dirs.
src/libxrpl/tx/transactors/check/CheckCash.cpp Replace account_ usage with accountID_ in destination handling, trustline/MPT creation logic, and dir removal.
src/libxrpl/tx/transactors/bridge/XChainBridge.cpp Replace account_ usage with accountID_ in submitting account info structs.
src/libxrpl/tx/transactors/account/SignerListSet.cpp Replace account_ usage with accountID_ in keylets/logging and signer list fields.
src/libxrpl/tx/transactors/account/SetRegularKey.cpp Replace account_ usage with accountID_ in account/signers lookup.
src/libxrpl/tx/transactors/account/AccountSet.cpp Replace account_ usage with accountID_ in account lookup and signer list checks.
src/libxrpl/tx/transactors/account/AccountDelete.cpp Replace account_ usage with accountID_ in source lookup, cleanup calls, and logging.
src/libxrpl/tx/Transactor.cpp Rename member initialization and update internal logic to use accountID_.
include/xrpl/tx/transactors/dex/AMMContext.h Rename context member from account_ to accountID_ and update accessor.
include/xrpl/tx/Transactor.h Rename protected member from account_ to accountID_.
include/xrpl/tx/paths/Offer.h Rename offer owner member from account_ to accountID_ and update usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 113 to 119
protected:
ApplyContext& ctx_;
beast::WrappedSink sink_;
beast::Journal const j_;

AccountID const account_;
AccountID const accountID_;
XRPAmount preFeeBalance_{}; // Balance before fees.
Comment on lines +679 to +687
auto const brokerBalanceAfter = accountID_ == brokerPayee ? STAmount{asset, 0}
: accountHolds(
view,
brokerPayee,
asset,
FreezeHandling::IgnoreFreeze,
AuthHandling::IgnoreAuth,
j_,
SpendableHandling::FullBalance);
@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.11111% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.1%. Comparing base (6809690) to head (51a2e1c).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
...c/libxrpl/tx/transactors/account/AccountDelete.cpp 80.0% 1 Missing ⚠️
src/libxrpl/tx/transactors/account/AccountSet.cpp 66.7% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #7284   +/-   ##
=======================================
  Coverage     82.1%   82.1%           
=======================================
  Files         1010    1010           
  Lines        76151   76163   +12     
  Branches      7415    7413    -2     
=======================================
+ Hits         62489   62502   +13     
+ Misses       13662   13661    -1     
Files with missing lines Coverage Δ
include/xrpl/tx/Transactor.h 100.0% <ø> (ø)
include/xrpl/tx/paths/Offer.h 96.7% <100.0%> (ø)
include/xrpl/tx/transactors/dex/AMMContext.h 100.0% <100.0%> (ø)
src/libxrpl/tx/Transactor.cpp 90.4% <100.0%> (ø)
...c/libxrpl/tx/transactors/account/SetRegularKey.cpp 100.0% <100.0%> (ø)
...c/libxrpl/tx/transactors/account/SignerListSet.cpp 92.0% <100.0%> (ø)
src/libxrpl/tx/transactors/bridge/XChainBridge.cpp 91.7% <100.0%> (+<0.1%) ⬆️
src/libxrpl/tx/transactors/check/CheckCash.cpp 91.3% <100.0%> (ø)
src/libxrpl/tx/transactors/check/CheckCreate.cpp 99.1% <100.0%> (+<0.1%) ⬆️
...pl/tx/transactors/credentials/CredentialAccept.cpp 100.0% <100.0%> (ø)
... and 42 more

... and 1 file with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

LGTM

@mvadari mvadari added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label May 18, 2026
@bthomee
bthomee added this pull request to the merge queue May 18, 2026
Merged via the queue into develop with commit ad7232c May 18, 2026
3 checks passed
@bthomee
bthomee deleted the mvadari/accountid_ branch May 18, 2026 11:39
@mvadari mvadari added this to the 3.2.0 milestone May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. Trivial Simple change with minimal effect, or already tested. Only needs one approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants