change . to ->

This commit is contained in:
Mayukha Vadari
2026-03-21 12:40:39 -07:00
parent 1ccd84e43a
commit c24432f43a
3 changed files with 13 additions and 13 deletions

View File

@@ -28,7 +28,7 @@ protected:
AccountID const id_;
public:
AccountRoot(AccountID const& id, ReadView const* view)
AccountRoot(AccountID const& id, ReadView const& view)
: ReadOnlySLE(view->read(keylet::account(id)), view), id_(id)
{
}
@@ -83,7 +83,7 @@ public:
class WritableAccountRoot : public AccountRoot, public WritableSLE
{
public:
WritableAccountRoot(AccountID const& id, ApplyView* view)
WritableAccountRoot(AccountID const& id, ApplyView& view)
: AccountRoot(id, view), WritableSLE(view->peek(keylet::account(id)), view)
{
}
@@ -113,7 +113,7 @@ pseudoAccountAddress(ReadView const& view, uint256 const& pseudoOwnerKey);
Pseudo-account designator fields MUST be maintained by including the
SField::sMD_PseudoAccount flag in the SField definition.
*/
[[nodiscard]] std::vector<SField const*> const&
[[nodiscard]] std::vector<SField&> const&
getPseudoAccountFields();
/** Returns true if and only if sleAcct is a pseudo-account or specific
@@ -127,7 +127,7 @@ getPseudoAccountFields();
[[nodiscard]] bool
isPseudoAccount(
std::shared_ptr<SLE const> sleAcct,
std::set<SField const*> const& pseudoFieldFilter = {});
std::set<SField&> const& pseudoFieldFilter = {});
/** Convenience overload that reads the account from the view. */
[[nodiscard]] inline bool

View File

@@ -53,7 +53,7 @@ public:
}
/** Returns the read view (always available) */
ReadView const*
ReadView const&
readView() const
{
return readView_;
@@ -77,13 +77,13 @@ protected:
ReadOnlySLE() = default;
/** Constructor for read-only context (ReadView) */
explicit ReadOnlySLE(std::shared_ptr<SLE const> sle, ReadView const* view)
explicit ReadOnlySLE(std::shared_ptr<SLE const> sle, ReadView const& view)
: sle_(std::move(sle)), readView_(view)
{
}
std::shared_ptr<SLE const> sle_; // Always valid (const view)
ReadView const* readView_; // Always valid
ReadView const& readView_; // Always valid
};
/**
@@ -123,7 +123,7 @@ public:
}
/** Returns the apply view for write operations */
ApplyView*
ApplyView&
applyView() const
{
return applyView_;
@@ -174,7 +174,7 @@ protected:
}
std::shared_ptr<SLE> mutableSle_; // Mutable SLE for write contexts
ApplyView* applyView_; // ApplyView for write contexts
ApplyView& applyView_; // ApplyView for write contexts
};
} // namespace xrpl

View File

@@ -66,15 +66,15 @@ AccountRoot::xrpLiquid(std::int32_t ownerCountAdj, beast::Journal j) const
{
// Return balance minus reserve
std::uint32_t const ownerCount = confineOwnerCount(
readView_->ownerCountHook(id_, sle_->getFieldU32(sfOwnerCount)), ownerCountAdj);
readView_.ownerCountHook(id_, sle_->getFieldU32(sfOwnerCount)), ownerCountAdj);
// Pseudo-accounts have no reserve requirement
auto const reserve =
isPseudoAccount(sle_) ? XRPAmount{0} : readView_->fees().accountReserve(ownerCount);
isPseudoAccount(sle_) ? XRPAmount{0} : readView_.fees().accountReserve(ownerCount);
auto const fullBalance = sle_->getFieldAmount(sfBalance);
auto const balance = readView_->balanceHook(id_, xrpAccount(), fullBalance);
auto const balance = readView_.balanceHook(id_, xrpAccount(), fullBalance);
STAmount const amount = (balance < reserve) ? STAmount{0} : balance - reserve;
@@ -104,7 +104,7 @@ WritableAccountRoot::adjustOwnerCount(std::int32_t amount, beast::Journal j)
std::uint32_t const current{mutableSle_->getFieldU32(sfOwnerCount)};
AccountID const id = (*mutableSle_)[sfAccount];
std::uint32_t const adjusted = confineOwnerCount(current, amount, id, j);
applyView_->adjustOwnerCountHook(id_, current, adjusted);
applyView_.adjustOwnerCountHook(id_, current, adjusted);
mutableSle_->at(sfOwnerCount) = adjusted;
update();
}