rippled
Loading...
Searching...
No Matches
directory.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2025 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_TEST_JTX_DIRECTORY_H_INCLUDED
21#define RIPPLE_TEST_JTX_DIRECTORY_H_INCLUDED
22
23#include <test/jtx/Env.h>
24
25#include <xrpl/basics/Expected.h>
26#include <xrpl/protocol/Feature.h>
27#include <xrpl/protocol/Indexes.h>
28
29#include <cstdint>
30#include <limits>
31
32namespace ripple::test::jtx {
33
35namespace directory {
36
45
54auto
56 Env& env,
57 std::uint64_t newLastPage,
58 Keylet directory,
61
66bool
68
69inline auto
71{
72 if (env.enabled(fixDirectoryLimit))
74 return dirNodeMaxPages - 1;
75}
76
77} // namespace directory
78
79} // namespace ripple::test::jtx
80
81#endif
Writeable view to a ledger, for applying a transaction.
Definition ApplyView.h:143
A transaction testing environment.
Definition Env.h:121
bool enabled(uint256 feature) const
Definition Env.h:638
T max(T... args)
auto bumpLastPage(Env &env, std::uint64_t newLastPage, Keylet directory, std::function< bool(ApplyView &, uint256, std::uint64_t)> adjust) -> Expected< void, Error >
Move the position of the last page in the user's directory on open ledger to newLastPage.
Definition directory.cpp:30
auto maximumPageIndex(Env const &env) -> std::uint64_t
Definition directory.h:70
bool adjustOwnerNode(ApplyView &view, uint256 key, std::uint64_t page)
Implementation of adjust for the most common ledger entry, i.e.
std::uint64_t constexpr dirNodeMaxPages
The maximum number of pages allowed in a directory.
Definition Protocol.h:62
A pair of SHAMap key and LedgerEntryType.
Definition Keylet.h:39