fix more AccountRoot stuff

This commit is contained in:
Mayukha Vadari
2026-03-21 13:20:19 -07:00
parent c24432f43a
commit add3d7e68d
2 changed files with 9 additions and 9 deletions

View File

@@ -29,7 +29,7 @@ protected:
public:
AccountRoot(AccountID const& id, ReadView const& view)
: ReadOnlySLE(view->read(keylet::account(id)), view), id_(id)
: ReadOnlySLE(view.read(keylet::account(id)), view), id_(id)
{
}
@@ -84,7 +84,7 @@ class WritableAccountRoot : public AccountRoot, public WritableSLE
{
public:
WritableAccountRoot(AccountID const& id, ApplyView& view)
: AccountRoot(id, view), WritableSLE(view->peek(keylet::account(id)), 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&
[[nodiscard]] std::vector<SField const*> 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& pseudoFieldFilter = {});
std::set<SField const*> const& pseudoFieldFilter = {});
/** Convenience overload that reads the account from the view. */
[[nodiscard]] inline bool

View File

@@ -119,7 +119,7 @@ public:
bool
canModify() const
{
return applyView_ != nullptr && mutableSle_ != nullptr;
return mutableSle_ != nullptr;
}
/** Returns the apply view for write operations */
@@ -147,28 +147,28 @@ public:
insert()
{
XRPL_ASSERT(canModify(), "xrpl::WritableSLE::insert : can modify");
applyView_->insert(mutableSle_);
applyView_.insert(mutableSle_);
}
void
erase()
{
XRPL_ASSERT(canModify(), "xrpl::WritableSLE::erase : can modify");
applyView_->erase(mutableSle_);
applyView_.erase(mutableSle_);
}
void
update()
{
XRPL_ASSERT(canModify(), "xrpl::WritableSLE::update : can modify");
applyView_->update(mutableSle_);
applyView_.update(mutableSle_);
}
protected:
WritableSLE() = default;
/** Constructor for read-write context (ApplyView) */
explicit WritableSLE(std::shared_ptr<SLE> sle, ApplyView* view)
explicit WritableSLE(std::shared_ptr<SLE> sle, ApplyView& view)
: mutableSle_(std::move(sle)), applyView_(view)
{
}