xrpld
Loading...
Searching...
No Matches
xrpl::test::jtx::directory Namespace Reference

Directory operations. More...

Enumerations

enum class  Error {
  DirectoryRootNotFound , DirectoryTooSmall , DirectoryPageDuplicate , DirectoryPageNotFound ,
  InvalidLastPage , AdjustmentError
}

Functions

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.
bool adjustOwnerNode (ApplyView &view, uint256 key, std::uint64_t page)
 Implementation of adjust for the most common ledger entry, i.e.
auto maximumPageIndex (Env const &env) -> std::uint64_t

Detailed Description

Directory operations.

Enumeration Type Documentation

◆ Error

Enumerator
DirectoryRootNotFound 
DirectoryTooSmall 
DirectoryPageDuplicate 
DirectoryPageNotFound 
InvalidLastPage 
AdjustmentError 

Definition at line 15 of file directory.h.

Function Documentation

◆ bumpLastPage()

auto xrpl::test::jtx::directory::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.

Requirements:

  • directory must have at least two pages (root and one more)
  • adjust should be used to update owner nodes of the objects affected
  • newLastPage must be greater than index of the last page in the directory

Use this to test tecDIR_FULL errors in open ledger. NOTE: effects will be DISCARDED on env.close()

Definition at line 25 of file directory.cpp.

◆ adjustOwnerNode()

bool xrpl::test::jtx::directory::adjustOwnerNode ( ApplyView & view,
uint256 key,
std::uint64_t page )

Implementation of adjust for the most common ledger entry, i.e.

one where page index is stored in sfOwnerNode (and only there). Pass this function to bumpLastPage if the last page of directory has only objects of this kind (e.g. ticket, DID, offer, deposit preauth, MPToken etc.)

Definition at line 126 of file directory.cpp.

◆ maximumPageIndex()

auto xrpl::test::jtx::directory::maximumPageIndex ( Env const & env) -> std::uint64_t

Definition at line 47 of file directory.h.