20#include <xrpld/app/tx/detail/PermissionedDomainDelete.h>
22#include <xrpl/ledger/View.h>
23#include <xrpl/protocol/TxFlags.h>
31 if (domain == beast::zero)
41 auto const sleDomain = ctx.
view.
read({ltPERMISSIONED_DOMAIN, domain});
48 "ripple::PermissionedDomainDelete::preclaim : required fields present");
49 if (sleDomain->getAccountID(sfOwner) != ctx.
tx.
getAccountID(sfAccount))
61 "ripple::PermissionedDomainDelete::doApply : required field present");
65 auto const page = (*slePd)[sfOwnerNode];
70 <<
"Unable to delete permissioned domain directory entry.";
76 ownerSle && ownerSle->getFieldU32(sfOwnerCount) > 0,
77 "ripple::PermissionedDomainDelete::doApply : nonzero owner count");
beast::Journal const journal
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
virtual void erase(std::shared_ptr< SLE > const &sle)=0
Remove a peeked SLE.
TER doApply() override
Attempt to delete the Permissioned Domain.
static TER preclaim(PreclaimContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
AccountID getAccountID(SField const &field) const
T::value_type at(TypedField< T > const &f) const
Get the value of a field.
bool isFieldPresent(SField const &field) const
uint256 getFieldH256(SField const &field) const
Keylet account(AccountID const &id) noexcept
AccountID root.
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void adjustOwnerCount(ApplyView &view, std::shared_ptr< SLE > const &sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
TERSubset< CanCvtToNotTEC > NotTEC
State information when determining if a tx is likely to claim a fee.
State information when preflighting a tx.