refactor: Rename account_ to accountID_ - #7284
Conversation
There was a problem hiding this comment.
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_toTransactor::accountID_and updated coreTransactorlogic accordingly. - Updated a broad set of transactors (vault, token, payment, escrow, lending, DEX/AMM, etc.) to use
accountID_in place ofaccount_. - Renamed similar members in
AMMContextandTOfferto 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.
| protected: | ||
| ApplyContext& ctx_; | ||
| beast::WrappedSink sink_; | ||
| beast::Journal const j_; | ||
|
|
||
| AccountID const account_; | ||
| AccountID const accountID_; | ||
| XRPAmount preFeeBalance_{}; // Balance before fees. |
| auto const brokerBalanceAfter = accountID_ == brokerPayee ? STAmount{asset, 0} | ||
| : accountHolds( | ||
| view, | ||
| brokerPayee, | ||
| asset, | ||
| FreezeHandling::IgnoreFreeze, | ||
| AuthHandling::IgnoreAuth, | ||
| j_, | ||
| SpendableHandling::FullBalance); |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
High Level Overview of Change
This PR renames the
account_field inTransactortoaccountID_(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