diff --git a/include/xrpl/ledger/helpers/AccountRootHelpers.h b/include/xrpl/ledger/helpers/AccountRootHelpers.h index 7e368c9965..849c84fd5a 100644 --- a/include/xrpl/ledger/helpers/AccountRootHelpers.h +++ b/include/xrpl/ledger/helpers/AccountRootHelpers.h @@ -27,7 +27,7 @@ namespace xrpl { template class AccountRoot : public SLEBase { - static constexpr bool is_writable = SLEBase::is_writable; + static constexpr bool isWritable = SLEBase::isWritable; AccountID const id_; @@ -37,7 +37,7 @@ public: AccountID const& id, ReadView const& view, beast::Journal j = beast::Journal{beast::Journal::getNullSink()}) - requires(!is_writable) + requires(!isWritable) : SLEBase(view.read(keylet::account(id)), view, j), id_(id) { } @@ -47,7 +47,7 @@ public: AccountID const& id, ApplyView& view, beast::Journal j = beast::Journal{beast::Journal::getNullSink()}) - requires is_writable + requires isWritable : SLEBase(keylet::account(id), view, j), id_(id) { } @@ -55,7 +55,7 @@ public: /** Converting constructor: writable → read-only. */ template AccountRoot(AccountRoot const& other) - requires(!is_writable) + requires(!isWritable) : SLEBase(other), id_(other.id()) { } @@ -67,7 +67,7 @@ public: AccountID const& id, ApplyView& view, beast::Journal j = beast::Journal{beast::Journal::getNullSink()}) - requires is_writable + requires isWritable { return AccountRoot(id, view, j, std::make_shared(keylet::account(id))); } @@ -141,12 +141,12 @@ public: /** Adjust the owner count up or down. */ void adjustOwnerCount(std::int32_t amount) - requires is_writable; + requires isWritable; private: // Private constructor only used by `makeNew` AccountRoot(AccountID const& id, ApplyView& view, beast::Journal j, std::shared_ptr sle) - requires is_writable + requires isWritable : SLEBase(std::move(sle), view, j), id_(id) { this->insert(); diff --git a/include/xrpl/ledger/helpers/SLEBase.h b/include/xrpl/ledger/helpers/SLEBase.h index 4ed5b8a3f9..f1c26ef946 100644 --- a/include/xrpl/ledger/helpers/SLEBase.h +++ b/include/xrpl/ledger/helpers/SLEBase.h @@ -32,13 +32,13 @@ template class SLEBase { public: - static constexpr bool is_writable = WritableView; + static constexpr bool isWritable = WritableView; // SLE pointer type: mutable for writable views, const for read-only - using sle_ptr_type = std::conditional_t, SLE::const_pointer>; + using sle_ptr_type = std::conditional_t, SLE::const_pointer>; // View reference type: ApplyView& for writable, ReadView const& for read-only - using view_ref_type = std::conditional_t; + using view_ref_type = std::conditional_t; virtual ~SLEBase() = default; @@ -99,7 +99,7 @@ public: /** Returns a mutable SLE for write operations */ sle_ptr_type const& mutableSle() const - requires is_writable + requires isWritable { return sle_; } @@ -107,7 +107,7 @@ public: /** Returns true if this wrapper supports write operations */ bool canModify() const - requires is_writable + requires isWritable { return sle_ != nullptr; } @@ -115,7 +115,7 @@ public: /** Returns the apply view for write operations */ ApplyView& applyView() const - requires is_writable + requires isWritable { return view_; } @@ -123,7 +123,7 @@ public: /** Mutable dereference operators */ STLedgerEntry* operator->() - requires is_writable + requires isWritable { XRPL_ASSERT(canModify(), "xrpl::SLEBase::operator-> : can modify"); return sle_.get(); @@ -131,7 +131,7 @@ public: STLedgerEntry& operator*() - requires is_writable + requires isWritable { XRPL_ASSERT(canModify(), "xrpl::SLEBase::operator* : can modify"); return *sle_; @@ -139,7 +139,7 @@ public: void insert() - requires is_writable + requires isWritable { XRPL_ASSERT(canModify(), "xrpl::SLEBase::insert : can modify"); view_.insert(sle_); @@ -147,7 +147,7 @@ public: void erase() - requires is_writable + requires isWritable { XRPL_ASSERT(canModify(), "xrpl::SLEBase::erase : can modify"); view_.erase(sle_); @@ -155,7 +155,7 @@ public: void update() - requires is_writable + requires isWritable { XRPL_ASSERT(canModify(), "xrpl::SLEBase::update : can modify"); view_.update(sle_); @@ -163,7 +163,7 @@ public: void newSLE() - requires is_writable + requires isWritable { XRPL_ASSERT(!canModify(), "xrpl::SLEBase::newSLE : sle_ is not null"); sle_ = std::make_shared(key_); @@ -183,7 +183,7 @@ protected: SLE::const_pointer sle, ReadView const& view, beast::Journal j = beast::Journal{beast::Journal::getNullSink()}) - requires(!is_writable) + requires(!isWritable) : view_(view), sle_(std::move(sle)), j_(j) { } @@ -195,7 +195,7 @@ protected: */ template SLEBase(SLEBase const& other) - requires(!is_writable) + requires(!isWritable) : view_(other.readView()), sle_(other.sle()), j_(other.journal()) { } @@ -205,7 +205,7 @@ protected: std::shared_ptr sle, ApplyView& view, beast::Journal j = beast::Journal{beast::Journal::getNullSink()}) - requires is_writable + requires isWritable : view_(view) , key_(sle ? Keylet(sle->getType(), sle->key()) : Keylet(ltANY, uint256{})) , sle_(std::move(sle)) @@ -218,7 +218,7 @@ protected: Keylet const& key, ApplyView& view, beast::Journal j = beast::Journal{beast::Journal::getNullSink()}) - requires is_writable + requires isWritable : view_(view), key_(key), sle_(view_.peek(key)), j_(j) { } @@ -231,7 +231,7 @@ protected: { }; [[no_unique_address]] - std::conditional_t key_{}; + std::conditional_t key_{}; sle_ptr_type sle_; beast::Journal j_; diff --git a/src/libxrpl/ledger/helpers/AccountRootHelpers.cpp b/src/libxrpl/ledger/helpers/AccountRootHelpers.cpp index 86981774d2..11a3536cb5 100644 --- a/src/libxrpl/ledger/helpers/AccountRootHelpers.cpp +++ b/src/libxrpl/ledger/helpers/AccountRootHelpers.cpp @@ -125,7 +125,7 @@ AccountRoot::transferRate() const template void AccountRoot::adjustOwnerCount(std::int32_t amount) - requires is_writable + requires isWritable { XRPL_ASSERT(this->canModify(), "xrpl::adjustOwnerCount : can modify"); XRPL_ASSERT(amount, "xrpl::adjustOwnerCount : nonzero amount input");