1#include <xrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.h>
3#include <xrpl/basics/Log.h>
4#include <xrpl/beast/utility/Zero.h>
5#include <xrpl/beast/utility/instrumentation.h>
6#include <xrpl/ledger/helpers/AccountRootHelpers.h>
7#include <xrpl/protocol/Indexes.h>
8#include <xrpl/protocol/SField.h>
9#include <xrpl/protocol/STLedgerEntry.h>
10#include <xrpl/protocol/STTx.h>
11#include <xrpl/protocol/TER.h>
12#include <xrpl/protocol/XRPAmount.h>
13#include <xrpl/tx/Transactor.h>
21 if (domain == beast::kZero)
38 "xrpl::PermissionedDomainDelete::preclaim : required fields present");
39 if (sleDomain->getAccountID(sfOwner) != ctx.
tx.
getAccountID(sfAccount))
50 ctx_.tx.isFieldPresent(sfDomainID),
51 "xrpl::PermissionedDomainDelete::doApply : required field present");
54 auto const page = (*slePd)[sfOwnerNode];
59 JLOG(
j_.fatal()) <<
"Unable to delete permissioned domain directory entry.";
66 ownerSle && ownerSle->getFieldU32(sfOwnerCount) > 0,
67 "xrpl::PermissionedDomainDelete::doApply : nonzero owner count");
A generic endpoint for log messages.
virtual SLE::pointer peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
virtual void erase(SLE::ref sle)=0
Remove a peeked SLE.
TER doApply() override
Attempt to delete the Permissioned Domain.
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
static NotTEC preflight(PreflightContext const &ctx)
static TER preclaim(PreclaimContext const &ctx)
bool finalizeInvariants(STTx const &tx, TER result, XRPAmount fee, ReadView const &view, beast::Journal const &j) override
Check transaction-specific post-conditions after all entries have been visited.
virtual SLE::const_pointer read(Keylet const &k) const =0
Return the state item associated with a key.
std::shared_ptr< STLedgerEntry const > const & const_ref
bool isFieldPresent(SField const &field) const
uint256 getFieldH256(SField const &field) const
AccountID getAccountID(SField const &field) const
AccountID const accountID_
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Keylet account(AccountID const &id) noexcept
AccountID root.
Keylet permissionedDomain(AccountID const &account, std::uint32_t seq) noexcept
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
TERSubset< CanCvtToNotTEC > NotTEC
void adjustOwnerCount(ApplyView &view, SLE::ref sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
TERSubset< CanCvtToTER > TER
State information when determining if a tx is likely to claim a fee.
State information when preflighting a tx.