xrpld
Loading...
Searching...
No Matches
directory.h
1#pragma once
2
3#include <test/jtx/Env.h>
4
5#include <xrpl/basics/base_uint.h>
6#include <xrpl/ledger/ApplyView.h>
7#include <xrpl/protocol/Feature.h>
8#include <xrpl/protocol/Keylet.h>
9#include <xrpl/protocol/Protocol.h>
10
11#include <cstdint>
12#include <expected>
13#include <functional>
14#include <limits>
15
20
29
40auto
42 Env& env,
43 std::uint64_t newLastPage,
45 std::function<bool(ApplyView&, uint256, std::uint64_t)> adjust) -> std::expected<void, Error>;
46
53bool
55
56inline auto
58{
59 if (env.enabled(fixDirectoryLimit))
61 return kDirNodeMaxPages - 1;
62}
63
64} // namespace xrpl::test::jtx::directory
Writeable view to a ledger, for applying a transaction.
Definition ApplyView.h:134
A transaction testing environment.
Definition Env.h:161
bool enabled(uint256 feature) const
Definition Env.h:884
T max(T... args)
Directory operations.
Definition directory.h:19
auto bumpLastPage(Env &env, std::uint64_t newLastPage, Keylet directory, std::function< bool(ApplyView &, uint256, std::uint64_t)> adjust) -> std::expected< void, Error >
Move the position of the last page in the user's directory on open ledger to newLastPage.
Definition directory.cpp:27
auto maximumPageIndex(Env const &env) -> std::uint64_t
Definition directory.h:57
bool adjustOwnerNode(ApplyView &view, uint256 key, std::uint64_t page)
Implementation of adjust for the most common ledger entry, i.e.
constexpr std::uint64_t kDirNodeMaxPages
The maximum number of pages allowed in a directory.
Definition Protocol.h:64
BaseUInt< 256 > uint256
Definition base_uint.h:580
A pair of SHAMap key and LedgerEntryType.
Definition Keylet.h:20