1#include <xrpl/ledger/helpers/OfferHelpers.h>
3#include <xrpl/basics/base_uint.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/beast/utility/instrumentation.h>
6#include <xrpl/ledger/ApplyView.h>
7#include <xrpl/ledger/helpers/AccountRootHelpers.h>
8#include <xrpl/protocol/Indexes.h>
9#include <xrpl/protocol/LedgerFormats.h>
10#include <xrpl/protocol/SField.h>
11#include <xrpl/protocol/STArray.h>
12#include <xrpl/protocol/STLedgerEntry.h>
13#include <xrpl/protocol/TER.h>
22 auto offerIndex = sle->key();
23 auto owner = sle->getAccountID(sfAccount);
26 uint256 const uDirectory = sle->getFieldH256(sfBookDirectory);
38 if (sle->isFieldPresent(sfAdditionalBooks))
41 sle->isFlag(lsfHybrid) && sle->isFieldPresent(sfDomainID),
42 "xrpl::offerDelete : should be a hybrid domain offer");
44 auto const& additionalBookDirs = sle->getFieldArray(sfAdditionalBooks);
46 for (
auto const& bookDir : additionalBookDirs)
48 auto const& dirIndex = bookDir.getFieldH256(sfBookDirectory);
49 auto const& dirNode = bookDir.getFieldU64(sfBookNode);
A generic endpoint for log messages.
Writeable view to a ledger, for applying a transaction.
virtual SLE::pointer peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
bool dirRemove(Keylet const &directory, std::uint64_t page, uint256 const &key, bool keepRoot)
Remove an entry from a directory.
virtual void erase(SLE::ref sle)=0
Remove a peeked SLE.
std::shared_ptr< STLedgerEntry > const & ref
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Keylet account(AccountID const &id) noexcept
AccountID root.
Keylet page(uint256 const &root, std::uint64_t index=0) noexcept
A page in a directory.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
TER offerDelete(ApplyView &view, SLE::ref sle, beast::Journal j)
Delete an offer.
void adjustOwnerCount(ApplyView &view, SLE::ref sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
TERSubset< CanCvtToTER > TER