20#include <xrpld/app/tx/detail/DID.h> 
   22#include <xrpl/basics/Log.h> 
   23#include <xrpl/ledger/ApplyView.h> 
   24#include <xrpl/ledger/View.h> 
   25#include <xrpl/protocol/Feature.h> 
   26#include <xrpl/protocol/Indexes.h> 
   27#include <xrpl/protocol/TxFlags.h> 
   57    auto isTooLong = [&](
auto const& sField, 
std::size_t length) -> 
bool {
 
   58        if (
auto field = ctx.
tx[~sField])
 
   59            return field->length() > length;
 
 
   83        auto const balance = 
STAmount((*sleAccount)[sfBalance]).
xrp();
 
   87        if (balance < reserve)
 
  100        (*sle)[sfOwnerNode] = *page;
 
 
  115        auto update = [&](
auto const& sField) {
 
  116            if (
auto const field = 
ctx_.
tx[~sField])
 
  120                    sleDID->makeFieldAbsent(sField);
 
  124                    (*sleDID)[sField] = *field;
 
  129        update(sfDIDDocument);
 
  132        if (!sleDID->isFieldPresent(sfURI) &&
 
  133            !sleDID->isFieldPresent(sfDIDDocument) &&
 
  134            !sleDID->isFieldPresent(sfData))
 
  146    auto set = [&](
auto const& sField) {
 
  147        if (
auto const field = 
ctx_.
tx[~sField]; field && !field->empty())
 
  148            (*sleDID)[sField] = *field;
 
  155        !sleDID->isFieldPresent(sfURI) &&
 
  156        !sleDID->isFieldPresent(sfDIDDocument) &&
 
  157        !sleDID->isFieldPresent(sfData))
 
 
  174    auto const sle = ctx.
view().
peek(sleKeylet);
 
 
  193        JLOG(j.
fatal()) << 
"Unable to delete DID Token from owner.";
 
 
A generic endpoint for log messages.
 
State information when applying a tx.
 
beast::Journal const journal
 
Writeable view to a ledger, for applying a transaction.
 
virtual void update(std::shared_ptr< SLE > const &sle)=0
Indicate changes to a peeked SLE.
 
bool dirRemove(Keylet const &directory, std::uint64_t page, uint256 const &key, bool keepRoot)
Remove an entry from a directory.
 
virtual void insert(std::shared_ptr< SLE > const &sle)=0
Insert a new state SLE.
 
std::optional< std::uint64_t > dirInsert(Keylet const &directory, uint256 const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
Insert an entry to a directory.
 
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.
 
static NotTEC preflight(PreflightContext const &ctx)
 
static TER deleteSLE(ApplyContext &ctx, Keylet sleKeylet, AccountID const owner)
 
static NotTEC preflight(PreflightContext const &ctx)
 
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
 
virtual Rules const & rules() const =0
Returns the tx processing rules.
 
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
 
bool isFieldPresent(SField const &field) const
 
Keylet did(AccountID const &account) noexcept
 
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.
 
std::size_t constexpr maxDIDURILength
The maximum length of a URI inside a DID.
 
std::size_t constexpr maxDIDAttestationLength
The maximum length of an Attestation inside a DID.
 
void adjustOwnerCount(ApplyView &view, std::shared_ptr< SLE > const &sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
 
TER addSLE(ApplyContext &ctx, std::shared_ptr< SLE > const &sle, AccountID const &owner)
 
bool set(T &target, std::string const &name, Section const §ion)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
 
std::size_t constexpr maxDIDDocumentLength
The maximum length of a Data element inside a DID.
 
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
 
@ tecINSUFFICIENT_RESERVE
 
TERSubset< CanCvtToTER > TER
 
TERSubset< CanCvtToNotTEC > NotTEC
 
XRPAmount accountReserve(std::size_t ownerCount) const
Returns the account reserve given the owner count, in drops.
 
A pair of SHAMap key and LedgerEntryType.
 
State information when preflighting a tx.